# Coverage Report

Watched: 134 fns/opr within `#.Conga`

The test suite was executed 12 times:

Executed at | APLVersion | Memory (MB)
--- | --- | ---
2022-10-06 12:50:29 | AIX ⋄ 18.2.46127.0 ⋄ S ⋄ Development ⋄ Classic | 252
2022-10-06 12:55:00 | AIX ⋄ 18.2.46127.0 ⋄ S ⋄ Development ⋄ Unicode | 252
2022-10-06 12:59:39 | AIX-64 ⋄ 18.2.46127.0 ⋄ S ⋄ Development ⋄ Classic | 251
2022-10-06 13:04:10 | AIX-64 ⋄ 18.2.46127.0 ⋄ S ⋄ Development ⋄ Unicode | 251
2022-10-06 13:09:00 | AIX ⋄ 19.0.46127.0 ⋄ S ⋄ Development ⋄ Classic | 252
2022-10-06 13:13:29 | AIX ⋄ 19.0.46127.0 ⋄ S ⋄ Development ⋄ Unicode | 252
2022-10-06 13:18:20 | AIX-64 ⋄ 19.0.46127.0 ⋄ S ⋄ Development ⋄ Classic | 251
2022-10-06 13:23:09 | AIX-64 ⋄ 19.0.46127.0 ⋄ S ⋄ Development ⋄ Unicode | 251
2022-10-06 13:28:22 | Mac-64 ⋄ 18.2.46127.0 ⋄ S ⋄ Development ⋄ Unicode | 251
2022-10-06 13:32:52 | Mac-64 ⋄ 19.0.46127.0 ⋄ S ⋄ Development ⋄ Unicode | 251
2022-10-06 13:38:06 | Linux ⋄ 18.2.46127.0 ⋄ S ⋄ Development ⋄ Unicode | 252
2022-10-06 13:43:20 | Linux ⋄ 19.0.46128.0 ⋄ S ⋄ Development ⋄ Unicode | 252

Overall 34% of the testable code is covered.

(Comment lines, empty lines, all `:End`* lines etc. are ignored)

50 of the fns/opr are 100% covered.

Function/Operator | Lines not executed | Coverage | ≢
--- | --- | --- | ---
#.Conga.Certs | 7 | 0 | 1
#.Conga.Clt | 5←≢1-3,6-7 | 0 | 5
#.Conga.New | 5←≢3-6,9 | 0 | 5
#.Conga.RootNames | 3, 4 | 0 | 2
#.Conga.SetParents | 4←≢1-4 | 0 | 4
#.Conga.Srv | 8←≢1-3,5,7-9,12 | 0 | 8
#.Conga.UnloadSharedLib | 1, 2 | 0 | 2
#.Conga.X509 | 4←≢1-3,6 | 0 | 4
#.Conga.Client.makeN | 4←≢4-7 | 0 | 4
#.Conga.Client.UnMake | 2 | 0 | 1
#.Conga.Client.Connect | 2, 3 | 0 | 2
#.Conga.Client.Close | 2, 3, 4 | 0 | 3
#.Conga.Client.SendRecv | 6←≢2,4,6-8,11 | 0 | 6
#.Conga.Client.Send | 2, 4 | 0 | 2
#.Conga.Client.Recv | 5←≢3-7 | 0 | 5
#.Conga.Connection.ServerArgs | 3 | 0 | 1
#.Conga.Connection.ServerProperties | 4 | 0 | 1
#.Conga.Connection.Progress | 2 | 0 | 1
#.Conga.Connection.Respond | 2 | 0 | 1
#.Conga.Connection.Send | 2 | 0 | 1
#.Conga.Connection.Close | 2, 3 | 0 | 2
#.Conga.Connection.makeN | 3, 4, 6 | 0 | 3
#.Conga.Connection.Test | 2 | 0 | 1
#.Conga.Connection.onReceive | 2 | 0 | 1
#.Conga.LIB.bit2problem | 1 | 0 | 1
#.Conga.LIB.Magic | 2 | 0 | 1
#.Conga.LIB.Progress | 3 | 0 | 1
#.Conga.LIB.SetRelay | 5 | 0 | 1
#.Conga.LIB.SetPropnt | 5 | 0 | 1
#.Conga.LIB.Micros | 2 | 0 | 1
#.Conga.LIB.Version | 7←≢2-4,6-7,10-11 | 0 | 7
#.Conga.LIB.Describe | 11←≢4-8,10-15 | 0 | 11
#.Conga.LIB.Exists | 3 | 0 | 1
#.Conga.LIB.Error | 3, 4, 6 | 0 | 3
#.Conga.LIB.Waitt | 5←≢4-6,8,10 | 0 | 5
#.Conga.LIB.ReadCertFromFolder | 5←≢3-5,7-8 | 0 | 5
#.Conga.LIB.ReadCertFromStore | 5←≢3-6,8 | 0 | 5
#.Conga.LIB.ReadCertUrls | 5←≢3-6,8 | 0 | 5
#.Conga.LIB.ClientAuth | 16←≢2-3,5-12,14-16,18,21-22 | 0 | 16
#.Conga.LIB.ServerAuth | 15←≢2-11,13-14,17,19-20 | 0 | 15
#.Conga.LIB.DecodeOptions | 6←≢3-8 | 0 | 6
#.Conga.X509Cert.set_UseMSStoreAPI | 1, 2 | 0 | 2
#.Conga.X509Cert.get_UseMSStoreAPI | 1 | 0 | 1
#.Conga.X509Cert.set_CertOrigin | 1 | 0 | 1
#.Conga.X509Cert.get_CertOrigin | 1 | 0 | 1
#.Conga.X509Cert.set_Key | 1 | 0 | 1
#.Conga.X509Cert.get_Key | 1 | 0 | 1
#.Conga.X509Cert.get_KeyOrigin | 1 | 0 | 1
#.Conga.X509Cert.set_ParentCert | 7←≢1-4,6,9-10 | 0 | 7
#.Conga.X509Cert.GetDN | 3, 4, 5 | 0 | 3
#.Conga.X509Cert.Save | 22←≢2-5,7-8,11,13-16,18-20,22-26,28,30,32 | 0 | 22
#.Conga.X509Cert.CopyCertificationChainFromStore | 13←≢5,7-9,11-12,14,16,18-19,21,24-25 | 0 | 13
#.Conga.X509Cert.IsCert | 5←≢2-3,5-6,8 | 0 | 5
#.Conga.X509Cert.Make0 | 5←≢3-7 | 0 | 5
#.Conga.X509Cert.Make3 | 5←≢3-7 | 0 | 5
#.Conga.X509Cert.Decode | 6←≢1,3-4,6,8-9 | 0 | 6
#.Conga.X509Cert.ReadCertUrls | 4, 5 | 0 | 2
#.Conga.X509Cert.ReadCertFromStore | 4, 5 | 0 | 2
#.Conga.X509Cert.ReadCertFromFolder | 4, 5 | 0 | 2
#.Conga.X509Cert.ReadCertFromFile | 4, 5 | 0 | 2
#.Conga.IWA.toAnsi | 1, 2 | 0 | 2
#.Conga.IWA.toAv | 1, 2 | 0 | 2
#.Conga.IWA.ClientAuth | 16←≢1-2,4-11,13-15,17,20-21 | 0 | 16
#.Conga.IWA.InitRawIWA | 6←≢1-6 | 0 | 6
#.Conga.IWA.IWAAuth | 10←≢1-10 | 0 | 10
#.Conga.IWA.IWAAuthVBtxt | 29←≢1-10,12-13,15-19,24-30,32-34,37,39 | 0 | 29
#.Conga.IWA.ServerAuth | 16←≢1-11,13-14,17,19-20 | 0 | 16
#.Conga.X509Cert.FindDRC | 5←≢4-8 | 17 | 6
#.Conga.X509Cert.Chain | 4←≢5-8 | 43 | 7
#.Conga.LIB.SetParents | 4, 5 | 60 | 5
#.Conga.LIB.SetParentCerts | 4, 5 | 60 | 5
#.Conga.Init | 8←≢7-11,23-24,31 | 62 | 21
#.Conga.DefPath | 6←≢9,11-12,14,17,21 | 65 | 17
#.Conga.LIB.MakeN | 5←≢11-15 | 67 | 15
#.Conga.X509Cert.get_ParentCert | 4 | 75 | 4
#.Conga.X509Cert.AsArg | 6, 9 | 78 | 9
#.Conga.FindInst | 4 | 80 | 5
#.Conga.LIB.Wait | 6 | 83 | 6
#.Conga.X509Cert.Make2 | 7 | 83 | 6
#.Conga.LIB.getarg | 4 | 86 | 7
#.Conga.LIB.InitInstance | 10 | 86 | 7
#.Conga.LIB.ReadCertFromFile | 19, 20 | 89 | 18
#.Conga.LIB.getargix | 10 | 90 | 10
#.Conga.LoadSharedLib | 40, 41 | 94 | 32
#.Conga.asAv |  | 100 | 0
#.Conga.cflate |  | 100 | 0
#.Conga.defaults |  | 100 | 0
#.Conga.enc |  | 100 | 0
#.Conga.ncase |  | 100 | 0
#.Conga.DefaultXlate |  | 100 | 4
#.Conga.ErrorText |  | 100 | 0
#.Conga.GetXlate |  | 100 | 0
#.Conga.KickStart |  | 100 | 0
#.Conga.Magic |  | 100 | 0
#.Conga.Micros |  | 100 | 0
#.Conga.NetSize |  | 100 | 0
#.Conga.SetXlate |  | 100 | 0
#.Conga.⍙CallR |  | 100 | 0
#.Conga.⍙CallRnt |  | 100 | 0
#.Conga.⍙CallRL |  | 100 | 0
#.Conga.⍙CallRLR |  | 100 | 0
#.Conga.⍙InitRPC |  | 100 | 0
#.Conga.⍙Version |  | 100 | 0
#.Conga.Client.enc |  | 100 | 0
#.Conga.Client.defaults |  | 100 | 0
#.Conga.Connection.onError |  | 100 | 0
#.Conga.Connection.onClose |  | 100 | 0
#.Conga.Connection.enc |  | 100 | 0
#.Conga.Connection.defaults |  | 100 | 0
#.Conga.LIB.reparg |  | 100 | 8
#.Conga.LIB.X509Cert |  | 100 | 1
#.Conga.LIB.UnMake |  | 100 | 2
#.Conga.LIB.Srv |  | 100 | 2
#.Conga.LIB.Send |  | 100 | 2
#.Conga.LIB.Clt |  | 100 | 2
#.Conga.LIB.Close |  | 100 | 1
#.Conga.LIB.Certs |  | 100 | 1
#.Conga.LIB.Names |  | 100 | 2
#.Conga.LIB.Respond |  | 100 | 1
#.Conga.LIB.SetProp |  | 100 | 1
#.Conga.LIB.Tree |  | 100 | 1
#.Conga.LIB.GetProp |  | 100 | 5
#.Conga.LIB.Decode |  | 100 | 6
#.Conga.LIB.enum |  | 100 | 0
#.Conga.LIB.size |  | 100 | 0
#.Conga.X509Cert.set_Cert |  | 100 | 2
#.Conga.X509Cert.get_Cert |  | 100 | 1
#.Conga.X509Cert.set_KeyOrigin |  | 100 | 1
#.Conga.X509Cert.set_Elements,Formatted,Extended |  | 100 | 0
#.Conga.X509Cert.get_Elements,Formatted,Extended |  | 100 | 0
#.Conga.X509Cert.Make1 |  | 100 | 5
#.Conga.X509Cert.split |  | 100 | 0
#.Conga.X509Cert.fixpath |  | 100 | 0
#.Conga.X509Cert.size |  | 100 | 0

## Listings

`#.Conga.Certs — 0%↟↑`
`r←Certs a` `[1] ⍝ Working with certificates.` `[2] ⍝ ListMSStores` `[3] ⍝ MSStore storename Issuer subject details api password` `[4] ⍝ Folder not implemented` `[5] ⍝ DER not implemented` `[6] ⍝ PK#12 not implemented` `→[7] r←check ⍙CallR RootName'ACerts'a 0`
`#.Conga.Clt — 0%↟↑`
`ref←{DRCref}Clt arg` `→[1] :If 0=⎕NC'DRCref'` `→[2] :OrIf DRCref≡⍬` `→[3] DRCref←Init''` `[4] :EndIf` `[5]` `→[6] (address service timeout)←(enc arg)defaults'localhost' 5000 10000` `→[7] ref←⎕NEW Client(DRCref address service timeout)`
`#.Conga.New — 0%↟↑`
`r←New name` `[1] ⍝ Create a NEW instance of Conga.LIB. If name is empty, generate an unused name.` `[2]` `→[3] :If (⊂name)∊names←RootNames` `→[4] ('Name in use: ',name)⎕SIGNAL 11` `→[5] :ElseIf name∧.=' '` `→[6] name←⊃('IC'∘,¨⍕¨⍳1+≢names)~names` `[7] :EndIf` `[8]` `→[9] r←Init name`
`#.Conga.RootNames — 0%↟↑`
`r←RootNames` `[1] ⍝ List root names of all instances of LIB` `[2]` `→[3] :If 0=⍴i←⎕INSTANCES LIB ⋄ r←0⍴⊂''` `→[4] :Else ⋄ r←i.RootName` `[5] :EndIf`
`#.Conga.SetParents — 0%↟↑`
`vc←SetParents vc` `→[1] ix←vc.Elements.Subject⍳vc.Elements.Issuer ⍝ find the index of the parents` `→[2] m←(ix≤⍴vc)∧ix≠⍳⍴ix ⍝ Mask the found items with parents and not selfsigned` `→[3] (m/vc).ParentCert←vc[m/ix] ⍝ Set the parent` `→[4] vc←vc~vc.ParentCert ⍝ remove all parents from list`
`#.Conga.Srv — 0%↟↑`
`ref←{DRCref}Srv arg` `→[1] :If 0=⎕NC'DRCref'` `→[2] :OrIf DRCref≡⍬` `→[3] DRCref←Init''` `[4] :EndIf` `→[5] (service conclass address extra)←(enc arg)defaults 5000 Connection''(⎕NS'')` `[6]` `→[7] :If 9≠⎕NC'conclass'` `→[8] :OrIf ~(⊂,Connection)∊{0::⍬ ⋄ ⎕CLASS ⍵}conclass` `→[9] ((⍕conclass),' is not a class deriving from Conga.Connection')⎕SIGNAL 11` `[10] :EndIf` `[11]` `→[12] ref←⎕NEW Server(DRCref service conclass address extra)`
`#.Conga.UnloadSharedLib — 0%↟↑`
`UnloadSharedLib` `→[1] z←⎕EX ⍙naedfns` `→[2] ⍙naedfns←⍬`
`#.Conga.X509 — 0%↟↑`
`ref←{DRCref}X509 arg` `→[1] :If 0=⎕NC'DRCref'` `→[2] :OrIf DRCref≡⍬` `→[3] DRCref←Init''` `[4] :EndIf` `[5]` `→[6] ref←⎕NEW X509Cert(DRCref,enc arg)`
`#.Conga.Client.makeN — 0%↟↑`
`makeN arg` `[1] :Access Public` `[2] :Implements Constructor` `[3]` `→[4] enc←{1=≡⍵:⊂⍵ ⋄ ⍵}` `→[5] defaults←{⍺,(⍴,⍺)↓⍵}` `→[6] name←⍬` `→[7] (LIB address service timeout)←(enc arg)defaults ⍬'localhost' 5000 20000` `[8]`
`#.Conga.Client.UnMake — 0%↟↑`
`UnMake` `[1] :Implements Destructor` `→[2] Close`
`#.Conga.Client.Connect — 0%↟↑`
`err←Connect` `[1] :Access Public` `→[2] r←0 Assert LIB.Clt''address service` `→[3] (err name)←2↑r`
`#.Conga.Client.Close — 0%↟↑`
`Close` `[1] :Access Public` `→[2] :If ⍬≢name` `→[3] _←LIB.Close name` `→[4] name←⍬` `[5] :EndIf`
`#.Conga.Client.SendRecv — 0%↟↑`
`data←SendRecv req` `[1] :Access Public` `→[2] data←⍬` `[3] ⍝ we could connect if somebody forgot` `→[4] :If ⍬≡name ⋄ _←Connect ⋄ :EndIf` `[5]` `→[6] (err cmd)←2↑res←Send req` `→[7] :If err≠0` `→[8] (⍕res)⎕SIGNAL 11` `[9] :EndIf` `[10]` `→[11] data←Recv cmd`
`#.Conga.Client.Send — 0%↟↑`
`res←Send req` `[1] :Access Public` `→[2] :If ⍬≡name ⋄ _←Connect ⋄ :EndIf ⍝ Connect if necessary` `[3]` `→[4] res←LIB.Send name req`
`#.Conga.Client.Recv — 0%↟↑`
`data←Recv cmd` `[1] :Access Public` `[2]` `→[3] :Repeat` `→[4] (err obj evt dat)←4↑0 Assert LIB.Wait cmd timeout` `→[5] :If evt≢'Timeout'` `→[6] data←dat` `→[7] :Leave` `[8] :EndIf` `[9] :EndRepeat`
`#.Conga.Connection.ServerArgs — 0%↟↑`
`ct←ServerArgs` `[1] :Access Public Shared` `[2] ⍝ return the type of connection you want` `→[3] ct←,⊂'Command'`
`#.Conga.Connection.ServerProperties — 0%↟↑`
`sp←srv ServerProperties name` `[1] :Access Public Shared` `[2] ⍝ Return the Properties to set for the server or` `[3] ⍝ use the srv ref to access srv and srv.LIB and do it yourself` `→[4] sp←⍬`
`#.Conga.Connection.Progress — 0%↟↑`
`e←Progress(obj data)` `[1] :Access Public` `→[2] e←srv.LIB.Progress obj data`
`#.Conga.Connection.Respond — 0%↟↑`
`e←Respond(obj data)` `[1] :Access Public` `→[2] e←srv.LIB.Respond obj data`
`#.Conga.Connection.Send — 0%↟↑`
`e←Send(data close)` `[1] :Access Public` `→[2] e←srv.LIB.Send Name data close`
`#.Conga.Connection.Close — 0%↟↑`
`Close obj` `[1] :Access Public` `→[2] srv.Remove Name` `→[3] _←srv.LIB.Close Name`
`#.Conga.Connection.makeN — 0%↟↑`
`makeN arg` `[1] :Access Public` `[2] :Implements Constructor` `→[3] enc←{1=≡⍵:⊂⍵ ⋄ ⍵}` `→[4] defaults←{⍺,(⍴,⍺)↓⍵}` `[5]` `→[6] (Name srv extra)←(enc arg)defaults''⍬(⎕NS'')`
`#.Conga.Connection.Test — 0%↟↑`
`r←Test` `[1] :Access Public` `→[2] r←42`
`#.Conga.Connection.onReceive — 0%↟↑`
`onReceive(obj data)` `[1] :Access Public Overridable` `→[2] Respond obj(⌽data)`
`#.Conga.LIB.bit2problem — 0%↟↑`
`r←bit2problem a` `→[1] r←a{(((⍴⍵)/2)⊤⍺)/⍵}'' 'CERT_INVALID' '' '' 'REVOKED' 'SIGNER_NOT_FOUND' 'SIGNER_NOT_CA' 'INSECURE_ALGORITHM' 'NOT_ACTIVATED' 'CERT_EXPIRED' 'SIGNATURE_FAILURE' 'REVOCATION_DATA_SUPERSEDED' '' 'UNEXPECTED_OWNER' 'REVOCATION_DATA_ISSUED_IN_FUTURE' 'SIGNER_CONSTRAINTS_FAILURE' 'MISMATCH'`
`#.Conga.LIB.Magic — 0%↟↑`
`m←Magic arg` `[1] :Access public` `→[2] m←(4/256)⊥⎕UCS 4↑arg`
`#.Conga.LIB.Progress — 0%↟↑`
`r←Progress a` `[1] :Access public` `[2] ⍝ cmd data` `→[3] ⎕IO←1 ⋄ r←check ##.Conga.⍙CallRL RootName'ARespondZ'(a[1],0)(2⊃a)`
`#.Conga.LIB.SetRelay — 0%↟↑`
`r←SetRelay a` `[1] :Access public` `[2] ⍝ Name Prop Value` `[3] ⍝ 'RelayFrom' 'RelayTo' [blocksize=16384 [oneway=0]]` `[4]` `→[5] r←check ##.Conga.⍙CallR RootName'ASetRelay'a 0`
`#.Conga.LIB.SetPropnt — 0%↟↑`
`r←SetPropnt a` `[1] :Access public` `[2] ⍝ Name Prop Value` `[3] ⍝ '.' 'CertRootDir' 'c:\certfiles\ca'` `[4]` `→[5] r←check ##.Conga.⍙CallRnt RootName'ASetProp'a 0`
`#.Conga.LIB.Micros — 0%↟↑`
`r←Micros` `[1] :Access public` `→[2] r←##.Conga.Micros`
`#.Conga.LIB.Version — 0%↟↑`
`v←Version` `[1] :Access public` `→[2] :Trap 0` `→[3] :If 0≠⎕NC'##.Conga.⍙Version'` `→[4] (err v)←##.Conga.⍙Version 3` `[5] :Else` `→[6] version←{no←(¯1+(⍵∊⎕D)⍳1)↓⍵ ⋄ 3↑⊃¨2⊃¨⎕VFI¨'.'{1↓¨(⍺=⍵)⊂⍵}'.',no}` `→[7] v←version 2 1 4⊃Tree'.'` `[8] :EndIf` `[9] :Else` `→[10] 'Try DRC.Init '⎕SIGNAL 16` `→[11] v←0 0 0` `[12] :EndTrap`
`#.Conga.LIB.Describe — 0%↟↑`
`r←Describe name` `[1] :Access public` `[2] ⍝ Return description of object` `[3]` `→[4] :If 0=1↑r←Tree name` `→[5] r←2 1⊃r` `→[6] enum←{2↓¨(⍵=1↑⍵)⊂⍵}` `→[7] state←enum',SNew,SIncoming,SRootInit,SListen,SConnected,SAPL,SReadyToSend,SSending,SProcessing,SReadyToRecv,SReceiving,SFinished,SMarkedForDeletion,SError,SDoNotChange,SShutdown,SSocketClosed,SAPLLast,SSSL,SSent,SListenPaused'` `→[8] type←enum',TRoot,TServer,TClient,TConnection,TCommand,TMessage'` `[9]` `→[10] :If 0=2⊃r ⍝ Root` `→[11] r←0('[DRC]'(4⊃r)('State=',(1+3⊃r)⊃state)('Threads=',⍕5⊃r))` `→[12] :Else ⍝ Something else` `→[13] (2⊃r)←(1+2⊃r)⊃type` `→[14] (3⊃r)←(1+3⊃r)⊃state` `→[15] r←0 r` `[16] :EndIf` `[17] :EndIf`
`#.Conga.LIB.Exists — 0%↟↑`
`r←Exists root` `[1] :Access public` `[2] ⍝ 1 if a Conga object name is in use` `→[3] r←0≡⊃⊃Tree root`
`#.Conga.LIB.Error — 0%↟↑`
`r←Error no` `[1] :Access public` `[2] ⍝ Return error text` `→[3] :If 0≠##.Conga.⎕NC'ErrorText'` `→[4] r←##.Conga.ErrorText no 100 100 256 256` `[5] :Else` `→[6] r←no'? Unknown Error' ''` `[7] :EndIf`
`#.Conga.LIB.Waitt — 0%↟↑`
`r←Waitt a` `[1] :Access public` `[2] ⍝ Name [timeout]` `[3] ⍝ returns: err Obj Evt Data` `→[4] ⎕IO←1` `→[5] :If (1≥≡a)∧∨/80 82∊⎕DR a` `→[6] a←(a)1000` `[7] :EndIf` `→[8] →(0≠⊃⊃r←check ##.Conga.⍙CallRLR RootName'AWaitZ'a 0)⍴0` `[9] ⍝:If 0=⊃⊃r ⋄ timing,←⊂(4⊃4↑⊃r),Micros ⋄ :EndIf` `→[10] r←(3↑⊃r),r[2],⊂(4⊃4↑⊃r),Micros`
`#.Conga.LIB.ReadCertFromFolder — 0%↟↑`
`certs←ReadCertFromFolder wildcardfilename` `[1] :Access Public Instance` `[2]` `→[3] filelist←1 0(⎕NINFO ⎕OPT 1)wildcardfilename` `→[4] files←filelist[;1]` `→[5] certs←⍬` `[6]` `→[7] :For f :In files` `→[8] certs,←ReadCertFromFile f` `[9] :EndFor`
`#.Conga.LIB.ReadCertFromStore — 0%↟↑`
`certs←ReadCertFromStore storename` `[1] :Access Public Instance` `[2]` `→[3] cs←Certs(⊂'MSStore'),⎕U2286 storename` `→[4] :If 0=1⊃cs` `→[5] :AndIf 0<⍴2⊃cs` `→[6] certs←⎕NEW¨(2⊃cs){X509Cert(⍺ ⍵)}¨⊂'MSStore'(⊃⎕U2286 storename)` `[7] :Else` `→[8] certs←⍬` `[9] :EndIf`
`#.Conga.LIB.ReadCertUrls — 0%↟↑`
`certs←ReadCertUrls` `[1] :Access Public Instance` `[2]` `→[3] certurls←Certs'Urls' ''` `→[4] :If 0=1⊃certurls` `→[5] :AndIf 0<1⊃⍴2⊃certurls` `→[6] certs←{⎕NEW X509Cert((4⊃⍵)('URL'(1⊃⍵))('URL'(2⊃⍵)))}¨↓2⊃certurls` `[7] :Else` `→[8] certs←⍬` `[9] :EndIf`
`#.Conga.LIB.ClientAuth — 0%↟↑`
`r←ClientAuth arg` `[1] :Access Public Instance` `→[2] :If 1=≡arg` `→[3] arg←,⊂arg` `[4] :EndIf` `→[5] con←1⊃arg` `→[6] err←SetProp con'IWA'('NTLM' '',1↓arg)` `→[7] :Repeat` `→[8] kp tok←2⊃GetProp con'Token'` `→[9] rc cmd←Send con(err kp tok)` `→[10] rr←Wait cmd 10000` `→[11] :If 0=⊃rr` `→[12] (se sk st)←3↑4⊃rr` `[13]` `→[14] :If 0<⍴st` `→[15] :AndIf se=0` `→[16] err←SetProp con'Token'(st)` `[17] :Else` `→[18] kp←0` `[19] :EndIf` `[20] :EndIf` `→[21] :Until (0=kp)∨(sk=0)` `→[22] r←GetProp con'IWA'`
`#.Conga.LIB.ServerAuth — 0%↟↑`
`r←ServerAuth con` `[1] :Access Public Instance` `→[2] err←SetProp con'IWA'('NTLM' '')` `→[3] :Repeat` `→[4] rr←Wait con 1000` `→[5] :If 0=⊃rr` `→[6] (ce ck ct)←3↑4⊃rr` `→[7] :If 0<⍴ct` `→[8] :AndIf ce=0` `→[9] err←SetProp con'Token'(ct)` `→[10] kp tok←2⊃GetProp con'Token'` `→[11] rc←Respond(2⊃rr)(err kp tok)` `[12] :Else` `→[13] rc←Respond(2⊃rr)(0 0 ⍬)` `→[14] kp←0` `[15] :EndIf` `[16] :Else` `→[17] kp←1` `[18] :EndIf` `→[19] :Until (0=kp)∨(ck=0)` `→[20] r←GetProp con'IWA'`
`#.Conga.LIB.DecodeOptions — 0%↟↑`
`r←DecodeOptions value` `[1] ⍝ returns the meaning of an Options value` `[2] :Access Public Shared` `→[3] ⎕IO←1` `→[4] opts←{↑⍵{(⍺⍎⍵)⍵}¨⍵.⎕NL ¯3}Options` `→[5] 'DOMAIN ERROR: Invalid Options'⎕SIGNAL((,1)≢,value∊0,⍳+/opts[;1])/11` `→[6] bits←⌽2*¯1+⎕U2378⌽2⊥⍣¯1⊢value` `→[7] inds←opts[;1]⍳bits` `→[8] r←1↓∊'+',¨opts[inds;2]`
`#.Conga.X509Cert.set_UseMSStoreAPI — 0%↟↑`
`set_UseMSStoreAPI args` `→[1] _usemsstoreapi←args.NewValue` `→[2] z←⎕EX¨'_Elements' '_Formatted' '_Extended'`
`#.Conga.X509Cert.get_UseMSStoreAPI — 0%↟↑`
`r←get_UseMSStoreAPI args` `→[1] r←_usemsstoreapi`
`#.Conga.X509Cert.set_CertOrigin — 0%↟↑`
`set_CertOrigin args` `→[1] _CertOrigin←args.NewValue`
`#.Conga.X509Cert.get_CertOrigin — 0%↟↑`
`r←get_CertOrigin args` `→[1] r←_CertOrigin`
`#.Conga.X509Cert.set_Key — 0%↟↑`
`set_Key args` `→[1] _Key←args.NewValue`
`#.Conga.X509Cert.get_Key — 0%↟↑`
`r←get_Key args` `→[1] ⎕SIGNAL 6`
`#.Conga.X509Cert.get_KeyOrigin — 0%↟↑`
`r←get_KeyOrigin args` `→[1] r←_KeyOrigin`
`#.Conga.X509Cert.set_ParentCert — 0%↟↑`
`set_ParentCert args` `→[1] :Trap 0` `→[2] :If 0<args.NewValue.IsCert` `→[3] :AndIf Elements.Issuer≡args.NewValue.Elements.Subject` `→[4] _ParentCert←args.NewValue` `[5] :Else` `→[6] 'Not a parent certificate'⎕SIGNAL 11` `[7] :EndIf` `[8] :Else` `→[9] 'Not a certificate'⎕SIGNAL 11` `→[10] _ParentCert←⍬` `[11] :EndTrap` `[12]`
`#.Conga.X509Cert.GetDN — 0%↟↑`
`r←items GetDN DN` `[1] ⍝ Get an item from a distiguished name` `[2]` `→[3] split←{1↓¨(⍺=⍺,⍵)⊂⍺,⍵}` `→[4] secs←'='split¨','split DN` `→[5] r←2⊃¨(secs,⊂'' '')[(1⊃¨secs)⍳items]` `[6]`
`#.Conga.X509Cert.Save — 0%↟↑`
`r←{name}Save path` `[1] :Access public` `→[2] :Trap 0` `→[3] fixpath←{⍵,(~∨/'/\'∊⊃⌽⍵)⍴('/\'∩⍵),'/'}` `→[4] :If 0<⎕NC'name'` `→[5] (name ext)←'.'{2↑1↓¨⍺{(⍺=⍵)⊂⍵}⍺,⍵}name,'.cer'` `[6] :Else` `→[7] name←⊃(⊂,'CN')GetDN ⎕THIS.Formatted.Subject` `→[8] ext←'cer'` `[9] :EndIf` `[10]` `→[11] path←fixpath path` `[12]` `→[13] :Select lcase ext` `→[14] :CaseList 'cer' 'pem'` `→[15] filename←path,name,'.',ext` `→[16] data←⊃,/('X509 CERTIFICATE'{pre←{'-----',⍺,' ',⍵,'-----'} ⋄ (⊂'BEGIN'pre ⍺),⍵,⊂'END'pre ⍺}↓64{s←(⌈(⍴⍵)÷⍺),⍺ ⋄ s⍴(×/s)↑⍵}base64 Cert),¨⊂⎕UCS 10 13` `[17] ⍝ remember to create the directory` `→[18] tn←filename ⎕NCREATE 0` `→[19] data ⎕NAPPEND tn 80` `→[20] ⎕NUNTIE tn` `[21]` `→[22] :Case 'der'` `→[23] filename←path,name,'.',ext` `→[24] tn←filename ⎕NCREATE 0` `→[25] (_Cert)⎕NAPPEND tn 83` `→[26] ⎕NUNTIE tn` `[27] :Else` `→[28] 'Unknown Certificate format'⎕SIGNAL 11` `[29] :EndSelect` `→[30] r←0` `[31] :Else` `→[32] r←⎕EN` `[33] :EndTrap`
`#.Conga.X509Cert.CopyCertificationChainFromStore — 0%↟↑`
`{r}←CopyCertificationChainFromStore` `[1] :Access Public` `[2] ⍝ Follow certificate chain from "⎕this" until a root certificate is found,` `[3] ⍝ Updating the ParentCert Property so the Certificate Chain is complete if possible` `[4]` `→[5] ⎕IO←1` `[6]` `→[7] trustroot←LDRC.X509Cert.ReadCertFromStore'root'` `→[8] trustca←LDRC.X509Cert.ReadCertFromStore'CA'` `→[9] current←⎕THIS` `[10]` `→[11] :Repeat` `→[12] :If foundroot←(⍴trustroot)≥rix←trustroot.Formatted.Subject⍳⊂current.Formatted.Issuer` `[13] ⍝ we have found the root cert` `→[14] current.ParentCert←rix⊃trustroot` `[15]` `→[16] :ElseIf (⍴trustca)≥iix←trustca.Formatted.Subject⍳⊂current.Formatted.Issuer` `[17] ⍝ we have found an intermediate cert` `→[18] current.ParentCert←iix⊃trustca` `→[19] current←current.ParentCert` `[20] :Else` `→[21] 'Unable to reach a root certificate'⎕SIGNAL 999` `[22] :EndIf` `[23]` `→[24] :Until foundroot` `→[25] r←⍴Chain`
`#.Conga.X509Cert.IsCert — 0%↟↑`
`r←IsCert` `[1] :Access public` `→[2] :If 2=⎕NC'DecodeOK'` `→[3] r←DecodeOK` `[4] :Else` `→[5] r←(0=⊃z←LDRC.Certs'Decode'_Cert)` `→[6] DecodeOK←r` `[7] :EndIf` `→[8] r+←(r=1)∧(_KeyOrigin≢'')∨_Key≢''`
`#.Conga.X509Cert.Make0 — 0%↟↑`
`Make0` `[1] :Access Public` `[2] :Implements Constructor` `→[3] Cert←''` `→[4] _Key←''` `→[5] _usemsstoreapi←0` `→[6] _CertOrigin←_KeyOrigin←('DER' '')` `→[7] LDRC←FindDRC''`
`#.Conga.X509Cert.Make3 — 0%↟↑`
`Make3(cert certorigin keyorigin)` `[1] :Access Public` `[2] :Implements Constructor` `→[3] Cert←cert` `→[4] _usemsstoreapi←0` `→[5] _CertOrigin←certorigin` `→[6] _KeyOrigin←keyorigin` `→[7] LDRC←FindDRC''`
`#.Conga.X509Cert.Decode — 0%↟↑`
`r←base Decode code` `→[1] ix←¯1+base⍳code` `[2]` `→[3] bits←,⍉((2⍟⍴base)⍴2)⊤ix` `→[4] size←{(⌊(¯1+⍺+⊃⍴⍵)÷⍺),⍺}` `[5]` `→[6] s←8 size bits` `[7]` `→[8] r←(8⍴2)⊥⍉s⍴(×/s)↑bits` `→[9] r←(-0=¯1↑r)↓r`
`#.Conga.X509Cert.ReadCertUrls — 0%↟↑`
`certs←ReadCertUrls` `[1] ⍝ NB Deprecated / for backwards compatibility` `[2] ⍝ Use instance method CertificateUrls` `[3] :Access Public Shared` `→[4] lDRC←FindDRC ⍬` `→[5] certs←lDRC.ReadCertUrls`
`#.Conga.X509Cert.ReadCertFromStore — 0%↟↑`
`certs←ReadCertFromStore storename` `[1] ⍝ NB Deprecated / for backwards compatibility` `[2] ⍝ Use instance method CertificateFromStore` `[3] :Access Public Shared` `→[4] lDRC←FindDRC ⍬` `→[5] certs←lDRC.ReadCertFromStore storename`
`#.Conga.X509Cert.ReadCertFromFolder — 0%↟↑`
`certs←ReadCertFromFolder foldername` `[1] ⍝ NB Deprecated / for backwards compatibility` `[2] ⍝ Use instance method CertificateFromFolder` `[3] :Access Public Shared` `→[4] lDRC←FindDRC ⍬` `→[5] certs←lDRC.ReadCertFromFolder foldername`
`#.Conga.X509Cert.ReadCertFromFile — 0%↟↑`
`certs←ReadCertFromFile filename` `[1] ⍝ NB Deprecated / for backwards compatibility` `[2] ⍝ Use instance method CertificateFromFolder` `[3] :Access Public Shared` `→[4] lDRC←FindDRC ⍬` `→[5] certs←lDRC.ReadCertFromFile filename`
`#.Conga.IWA.toAnsi — 0%↟↑`
`r←toAnsi a` `→[1] ⎕IO←0` `→[2] r←⎕AV[(⎕NXLATE 0)[⎕AV⍳a]]`
`#.Conga.IWA.toAv — 0%↟↑`
`r←toAv a` `→[1] ⎕IO←0` `→[2] r←⎕AV[((⎕NXLATE 0)⍳⍳256)[⎕AV⍳a]]`
`#.Conga.IWA.ClientAuth — 0%↟↑`
`r←ClientAuth arg` `→[1] :If 1=≡arg` `→[2] arg←,⊂arg` `[3] :EndIf` `→[4] con←1⊃arg` `→[5] err←SetProp con'IWA'('NTLM' '',1↓arg)` `→[6] :Repeat` `→[7] kp tok←2⊃GetProp con'Token'` `→[8] rc cmd←Send con(err kp tok)` `→[9] rr←Wait cmd 10000` `→[10] :If 0=⊃rr` `→[11] (se sk st)←3↑4⊃rr` `[12]` `→[13] :If 0<⍴st` `→[14] :AndIf se=0` `→[15] err←SetProp con'Token'(st)` `[16] :Else` `→[17] kp←0` `[18] :EndIf` `[19] :EndIf` `→[20] :Until (0=kp)∨(sk=0)` `→[21] r←GetProp con'IWA'`
`#.Conga.IWA.InitRawIWA — 0%↟↑`
`r←InitRawIWA dllname` `→[1] ⍙naedfns,←⊂'IWAStart'⎕NA dllname,'IFAuthClientStart >P <0T1 <0T1'` `→[2] ⍙naedfns,←⊂'IWAGet'⎕NA dllname,'IFAuthGetToken P >U4 =U4 >C1[]'` `→[3] ⍙naedfns,←⊂'IWASet'⎕NA dllname,'IFAuthSetToken P U4 <C1[]'` `→[4] ⍙naedfns,←⊂'IWAFree'⎕NA dllname,'IFAuthFree P '` `→[5] ⍙naedfns,←⊂'IWAName'⎕NA dllname,'IFAuthName P >0T1'` `→[6] r←0`
`#.Conga.IWA.IWAAuth — 0%↟↑`
`r←IWAAuth con` `→[1] err HANDLE←IWAStart 1 'NTLM' ''` `→[2] :Repeat` `→[3] err kp len tok←IWAGet HANDLE 1 200 200` `→[4] tok←len↑tok` `→[5] rc cmd←Send con tok` `→[6] rr←Wait cmd 10000` `→[7] tok←4⊃rr` `→[8] IWASet HANDLE(⍴tok)tok` `→[9] :Until 0=kp` `→[10] r←IWAName HANDLE 100` `[11] ⍝ r←GetProp con'IWA'`
`#.Conga.IWA.IWAAuthVBtxt — 0%↟↑`
`r←IWAAuthVBtxt con` `→[1] SetProp con'IWA'('NTLM' '')` `→[2] :Repeat` `→[3] header←''` `→[4] size←0` `→[5] tok←''` `→[6] :Repeat` `→[7] rr←Wait con 1000` `→[8] :If 0=⊃rr` `→[9] :If size>0` `→[10] tok,←4⊃rr` `[11] :Else` `→[12] :If 16>⍴header` `→[13] header,←(16-⍴header)↑4⊃rr` `[14] :EndIf` `→[15] :If 16=⍴header ⍝ header form '<IWA nnnnn>'` `→[16] :AndIf '<'=1↑header` `→[17] :AndIf '>'=¯1↑header` `→[18] size←2⊃⎕VFI 5↓15↑header` `→[19] tok←16↓4⊃rr` `[20]` `[21] :EndIf` `[22] :EndIf` `[23] :EndIf` `→[24] :Until (size>0)∧size=⍴tok` `→[25] :If 0=⊃rr` `→[26] SetProp con'Token'(toAnsi tok)` `→[27] kp tokout←2⊃GetProp con'Token'` `→[28] :If kp=1` `→[29] Send con('<IWA',(¯11↑(⍕⍴tokout)),'>')` `→[30] Send con(toAv tokout)` `[31] :Else` `→[32] r←GetProp con'IWA'` `→[33] Send con('<IWAc',(¯10↑(⍕⍴2⊃r)),'>')` `→[34] Send con(2⊃r)` `[35] :EndIf` `[36] :Else` `→[37] kp←1` `[38] :EndIf` `→[39] :Until 0=kp`
`#.Conga.IWA.ServerAuth — 0%↟↑`
`r←ServerAuth con` `→[1] err←SetProp con'IWA'('NTLM' '')` `→[2] ck←kp←1` `→[3] :Repeat` `→[4] rr←Wait con 1000` `→[5] :If 0=⊃rr` `→[6] (ce ck ct)←3↑4⊃rr` `→[7] :If 0<⍴ct` `→[8] :AndIf ce=0` `→[9] err←SetProp con'Token'(ct)` `→[10] kp tok←2⊃GetProp con'Token'` `→[11] rc←Respond(2⊃rr)(err kp tok)` `[12] :Else` `→[13] rc←Respond(2⊃rr)(0 0 ⍬)` `→[14] kp←0` `[15] :EndIf` `[16] :Else` `→[17] kp←1` `[18] :EndIf` `→[19] :Until (0=kp)∨(ck=0)` `→[20] r←GetProp con'IWA'`
`#.Conga.X509Cert.FindDRC — 17%↟↑`
`ldrc←FindDRC dummy` `[1] ⍝ Establish a pointer to a Conga instance or a v2 DRC namspace` `[2] :If ''≢LDRC ⋄ ldrc←LDRC ⍝ Ref already set` `[3] :Else` `→[4] :For ref :In ##,##.## ⍝ search parent and grandparent` `→[5] :If 9=ref.⎕NC'Conga' ⍝ Else use Conga factory function` `→[6] ldrc←ref.Conga.Init''` `→[7] :ElseIf 9=ref.⎕NC'DRC' ⍝ Look for v2 DRC namespace` `→[8] ldrc←ref.DRC` `[9] :EndIf` `[10] :EndFor` `[11] :EndIf`
`#.Conga.X509Cert.Chain — 43%↟↑`
`chain←Chain` `[1] :Access Public` `[2] chain←,⊂⎕THIS` `[3] pc←ParentCert` `[4] :While ⍬≢pc` `→[5] :AndIf 0<pc.IsCert` `→[6] :AndIf (⊃¯1↑chain).Elements.Subject≢pc.Elements.Subject` `→[7] chain,←pc` `→[8] pc←pc.ParentCert` `[9] :EndWhile`
`#.Conga.LIB.SetParents — 60%↟↑`
`vc←SetParents vc` `[1] :Access Public Instance` `[2] ix←vc.Elements.Subject⍳vc.Elements.Issuer ⍝ find the index of the parents` `[3] :If ∨/m←(ix≤⍴vc)∧ix≠⍳⍴ix ⍝ Mask the found items with parents and not selfsigned` `→[4] (m/vc).ParentCert←vc[m/ix] ⍝ Set the parent` `→[5] :EndIf ⍝ NB the :If prevents creation of an empty cert to allow above line to work` `[6] vc←vc~vc.ParentCert ⍝ remove all parents from list`
`#.Conga.LIB.SetParentCerts — 60%↟↑`
`vc←SetParentCerts vc` `[1] ⍝ Set parent certificates` `[2] ix←vc.Elements.Subject⍳vc.Elements.Issuer ⍝ find the index of the parents` `[3] :If ∨/m←(ix≤⍴vc)∧ix≠⍳⍴ix ⍝ Mask the found items with parents and not selfsigned` `→[4] (m/vc).ParentCert←vc[m/ix] ⍝ Set the parent` `→[5] :EndIf ⍝ NB the :If prevents creation of an empty cert to allow above line to work` `[6] vc←vc~vc.ParentCert ⍝ remove all parents from list`
`#.Conga.Init — 62%↟↑`
`ref←{libpath}Init arg` `[1] :If 0=⎕NC'libpath' ⋄ libpath←'' ⋄ :EndIf` `[2]` `[3] :Trap 0` `[4] lcase←0∘(819⌶)` `[5] z←lcase'A' ⍝ Try to use it` `[6] :Else` `→[7] lowerAlphabet←'abcdefghijklmnopqrstuvwxyzáâãçèêëìíîïðòóôõùúûýàäåæéñöøü'` `→[8] upperAlphabet←'ABCDEFGHIJKLMNOPQRSTUVWXYZÁÂÃÇÈÊËÌÍÎÏÐÒÓÔÕÙÚÛÝÀÄÅÆÉÑÖØÜ'` `→[9] fromto←{n←⍴1⊃(t f)←⍺ ⋄ ~∨/b←n≥i←f⍳s←,⍵:s ⋄ (b/s)←t[b/i] ⋄ (⍴⍵)⍴s} ⍝ from-to casing fn` `→[10] lc←lowerAlphabet upperAlphabet∘fromto ⍝ :Includable Lower-casification of simple array` `→[11] lcase←{2=≡⍵:∇¨⍵ ⋄ lc ⍵}` `[12] :EndTrap` `[13]` `[14] ncase←{(lcase ⍺)⍺⍺(lcase ⍵)} ⍝ case-insensitive operator` `[15]` `[16] rootname←⊃((0≠≢arg)/enc arg)defaults,⊂'DEFAULT'` `[17]` `[18] :Hold 'Conga.Init'` `[19] isLoaded←3=⎕NC'⍙InitRPC'` `[20] :If 0=⊃r←LoadSharedLib libpath ⍝ Sets LibPath as side-effect` `[21] :If isLoaded≠3=⎕NC'⍙InitRPC' ⍝ the shared lib has been loaded revitalize all the instances` `[22] :AndIf 0<≢x←⎕INSTANCES⊃⊃⎕CLASS LIB` `→[23] x.LibPath←⊂LibPath` `→[24] x.InitInstance` `[25] :EndIf` `[26]` `[27] :If ⍬≡ref←FindInst rootname` `[28] ref←##.⎕NEW LIB(LibPath rootname) ⍝ NB always create instances in the parent space` `[29] :EndIf` `[30] :Else` `→[31] ('Unable to load shared library: ',⍕r)⎕SIGNAL 999` `[32] :EndIf` `[33] :EndHold`
`#.Conga.DefPath — 65%↟↑`
`p←DefPath p` `[1] subst←{((1⊃⍺),⍵)[1+(⍳⍴⍵)×⍵≠2⊃⍺]}` `[2] isWin←{'Window'{⍺≡(⍴⍺)↑⍵}⎕IO⊃'.'⎕WG'aplversion'}` `[3] ds←'/\'[⎕IO+isWin ⍬]` `[4] trunkds←{⍺←ds ⋄ (1-(⌽⍵)⍳⍺)↓⍵}` `[5] addds←{⍺←ds ⋄ ⍵,(⍺≠¯1↑⍵)/⍺}` `[6]` `[7] :Select p` `[8] :Case '⍵' ⍝ means path of the ws` `→[9] p←trunkds ⎕WSID` `[10] :Case '↓' ⍝ means current path` `→[11] :If isWin ⍬` `→[12] p←addds⊃⎕CMD'cd'` `[13] :Else` `→[14] p←addds⊃⎕CMD'pwd'` `[15] :EndIf` `[16] :Case '⍺' ⍝ means the path of the interpreter` `→[17] p←trunkds ⎕IO⊃+2 ⎕NQ'.' 'GetCommandlineArgs'` `[18] :CaseList ⍬''` `[19] p←p` `[20] :Else` `→[21] p←addds((isWin ⍬)⌽'/\')subst p` `[22] :EndSelect`
`#.Conga.LIB.MakeN — 67%↟↑`
`MakeN arg` `[1] :Access Public` `[2] :Implements Constructor` `[3] WsAutoUpgrade←1` `[4] RawAsByte←2` `[5] DecodeHttp←4` `[6] RawAsInt←8` `[7] :Trap 0` `[8] lcase←0∘(819⌶)` `[9] z←lcase'A' ⍝ Try to use it` `[10] :Else` `→[11] lowerAlphabet←'abcdefghijklmnopqrstuvwxyzáâãçèêëìíîïðòóôõùúûýàäåæéñöøü'` `→[12] upperAlphabet←'ABCDEFGHIJKLMNOPQRSTUVWXYZÁÂÃÇÈÊËÌÍÎÏÐÒÓÔÕÙÚÛÝÀÄÅÆÉÑÖØÜ'` `→[13] fromto←{n←⍴1⊃(t f)←⍺ ⋄ ~∨/b←n≥i←f⍳s←,⍵:s ⋄ (b/s)←t[b/i] ⋄ (⍴⍵)⍴s} ⍝ from-to casing fn` `→[14] lc←lowerAlphabet upperAlphabet∘fromto ⍝ :Includable Lower-casification of simple array` `→[15] lcase←{2=≡⍵:∇¨⍵ ⋄ lc ⍵}` `[16] :EndTrap` `[17]` `[18] ncase←{(lcase ⍺)⍺⍺(lcase ⍵)} ⍝ case-insensitive operator` `[19]` `[20] (LibPath RootName)←2↑arg` `[21]` `[22] InitInstance`
`#.Conga.X509Cert.get_ParentCert — 75%↟↑`
`r←get_ParentCert args` `[1] r←⍬` `[2] :Trap 0` `[3] :If 0<_ParentCert.IsCert` `→[4] r←_ParentCert` `[5] :EndIf` `[6]` `[7]` `[8] :EndTrap`
`#.Conga.X509Cert.AsArg — 78%↟↑`
`arg←AsArg` `[1] :Access Public` `[2] arg←⍬` `[3] :If ''≢_Cert` `[4] arg,←⊂'PublicCertData'Chain.Cert` `[5] :ElseIf ''≢_CertOrigin` `→[6] arg,←⊂'PublicCertFile'_CertOrigin` `[7] :EndIf` `[8] :If ''≢_Key` `→[9] arg,←⊂'PrivateKeyData'_Key` `[10] :ElseIf ''≢_KeyOrigin` `[11] arg,←⊂'PrivateKeyFile'(_KeyOrigin)` `[12] :EndIf`
`#.Conga.FindInst — 80%↟↑`
`ref←FindInst rootname` `[1] inst←⎕INSTANCES⊃⊃⎕CLASS LIB` `[2] :If 0<⍴inst` `[3] :AndIf (ix←inst.RootName⍳⊂rootname)≤⍴inst` `→[4] ref←inst[ix]` `[5] :Else` `[6] ref←⍬` `[7] :EndIf`
`#.Conga.LIB.Wait — 83%↟↑`
`r←Wait a` `[1] :Access public` `[2] ⍝ Name [timeout]` `[3] ⍝ returns: err Obj Evt Data` `[4] ⎕IO←1` `[5] :If (1≥≡a)∧∨/80 82∊⎕DR a` `→[6] a←(a)1000` `[7] :EndIf` `[8] →(0≠⊃⊃r←check ##.Conga.⍙CallRLR RootName'AWaitZ'a 0)⍴0` `[9] ⍝:If 0=⊃⊃r ⋄ timing,←⊂(4⊃4↑⊃r),Micros ⋄ :EndIf` `[10] r←(3↑⊃r),r[2]` `[11] :If 0<⎕NC'⍙Stat' ⋄ Stat r ⋄ :EndIf` `[12]`
`#.Conga.X509Cert.Make2 — 83%↟↑`
`Make2(cert origin)` `[1] :Access Public` `[2] :Implements Constructor` `[3] Cert←cert` `[4] _usemsstoreapi←0` `[5] _CertOrigin←origin` `[6] :If 'MSStore'≡1⊃origin` `→[7] _KeyOrigin←origin` `[8] :EndIf` `[9] LDRC←FindDRC''`
`#.Conga.LIB.getarg — 86%↟↑`
`r←a getarg ixs` `[1] m←0<ixs` `[2] r←(⍴ixs)⍴⍬` `[3] :If ∨/m` `→[4] (m/r)←a[m/ixs]` `[5] :EndIf` `[6] m←~m` `[7] :If ∨/m` `[8] (m/r)←2⊃¨a[-m/ixs]` `[9] :EndIf`
`#.Conga.LIB.InitInstance — 86%↟↑`
`InitInstance` `[1] :Access public` `[2] :If 3=##.Conga.⎕NC'⍙InitRPC'` `[3] z←##.Conga.⍙InitRPC RootName LibPath` `[4] :Select ⊃z` `[5] :Case 0` `[6] :If 80≠⎕DR' '` `[7] s←##.Conga.(SetXlate DefaultXlate)` `[8] :EndIf` `[9] :Else` `→[10] (,⍕Error z)⎕SIGNAL 999` `[11] :EndSelect` `[12] :EndIf`
`#.Conga.LIB.ReadCertFromFile — 89%↟↑`
`certs←ReadCertFromFile filename` `[1] :Access Public Instance` `[2]` `[3] certs←⍬` `[4] c←'-----BEGIN X509 CERTIFICATE-----' '-----BEGIN CERTIFICATE-----'` `[5] base64←'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'` `[6] tie←filename ⎕NTIE 0` `[7] size←⎕NSIZE tie` `[8] cert←⎕NREAD tie 82 size` `[9] ixs←c{⊃,/{(⍳⍴⍵),¨¨⍵}⍺{(⍺⍷⍵)/⍳⍴⍵}¨⊂⍵}cert` `[10] :If 0<⍴ixs` `[11] :For ix :In ixs` `[12] d←((2⊃ix)+⍴⊃c[1⊃ix])↓cert` `[13] d←(¯1+⊃d⍳'-')↑d` `[14] d←(d∊base64)/d` `[15] d←base64 Decode d` `[16] certs,←⎕NEW X509Cert(d('DER'filename))` `[17] :EndFor` `[18] :Else` `→[19] cert←⎕NREAD tie 83 size 0` `→[20] certs,←⎕NEW X509Cert(cert('DER'filename))` `[21] :EndIf` `[22]` `[23] ⎕NUNTIE tie` `[24] certs←SetParents certs`
`#.Conga.LIB.getargix — 90%↟↑`
`r←arg getargix(args list)` `[1] ⍝ Finds argumenst in a list of positional and named arguments` `[2]` `[3] ixs←list⍳ncase args` `[4]` `[5] nix←+/∧\2>|≡¨arg ⍝ identify where the named arguments starts` `[6]` `[7] r←(⍴ixs)⍴1+⍴list ⍝ prefill the result` `[8] mp←ixs≤nix` `[9] :If ∨/mp ⍝ for positionals args` `→[10] (mp/r)←mp/ixs` `[11] :EndIf` `[12] mn←(~mp)∧ixs<1+⍴list` `[13] :If ∨/mn ⍝ for named args.` `[14] :AndIf nix<⍴arg` `[15] (mn/r)←-nix+(1⊃¨nix↓arg)⍳ncase mn/args` `[16]` `[17] :EndIf`
`#.Conga.LoadSharedLib — 94%↟↑`
`r←LoadSharedLib path` `[1] :If 3=⎕NC'⍙InitRPC' ⍝ Library already loaded` `[2] r←0 'Conga already loaded'` `[3] :Else ⍝ Not loaded` `[4] {}⎕WA ⍝ If there is garbage holding the shared library loaded get rid of it` `[5] unicode←⊃80=⎕DR' '` `[6] mac win bit64←∨/¨'Mac' 'Windows' '64'⍷¨⊂1⊃'.'⎕WG'APLVersion'` `[7] ⍝ Dllname is Conga[x64 if 64-bit][Uni if Unicode][.so if UNIX]` `[8] filename←'conga',DllVer,(⊃'__CU'[⎕IO+unicode]),(⊃('32' '64')[⎕IO+bit64]),⊃('' '.so' '.dylib')[⎕IO+mac+~win]` `[9] dirsep←'/\'[⎕IO+win]` `[10] LibPath←DefPath path` `[11] s←''` `[12]` `[13] :Trap 0` `[14] ⍙naedfns←⍬` `[15] dllname←'I4 "',LibPath,filename,'"|'` `[16]` `[17] ⍙naedfns,←⊂'⍙CallR'⎕NA dllname,'Call <0T1 <0T1 =Z <U',⍕4×1+bit64 ⍝ No left arg` `[18] ⍙naedfns,←⊂'⍙CallRL'⎕NA dllname,'Call <0T1 <0T1 =Z <Z' ⍝ Left input` `[19] ⍙naedfns,←⊂'⍙CallRnt'⎕NA dllname,'Call <0T1 <0T1 =Z <U',⍕4×1+bit64 ⍝ No left arg` `[20] ⍙naedfns,←⊂'⍙CallRLR'⎕NA dllname,'Call1& <0T1 <0T1 =Z >Z' ⍝ Left output` `[21] ⍙naedfns,←⊂'KickStart'⎕NA dllname,'KickStart& <0T1'` `[22] ⍙naedfns,←⊂'SetXlate'⎕NA dllname,'SetXLate <0T <0T <C[256] <C[256]'` `[23] ⍙naedfns,←⊂'GetXlate'⎕NA dllname,'GetXLate <0T <0T >C[256] >C[256]'` `[24] :Trap 0` `[25] ⍙naedfns,←⊂'⍙Version'⎕NA dllname,'Version >I4[3]'` `[26] ⍙naedfns,←⊂⎕NA'F8',2↓dllname,'Micros'` `[27] ⍙naedfns,←⊂⎕NA dllname,'cflate I4 =P <U1[] =U4 >U1[] =U4 I4'` `[28] ⍙naedfns,←⊂⎕NA dllname,'ErrorText I4 >0T1 <I4 >0T1 <I4'` `[29] :EndTrap` `[30] :Trap 0` `[31] z←InitRawIWA dllname` `[32] :EndTrap` `[33] ⍙naedfns,←⊂'⍙InitRPC'⎕NA dllname,'Init <0T1 <0T1'` `[34]` `[35] :EndTrap` `[36]` `[37] :If 3=⎕NC'⍙InitRPC'` `[38] r←0('Conga loaded from: ',LibPath,filename)` `[39] :Else` `→[40] :If 0≠≢⍙naedfns ⋄ z←⎕EX¨⍙naedfns ⋄ :EndIf` `→[41] r←1000('Unable to find DLL "',filename,'"')((0≠≢LibPath)/'Tried: ',,⍕LibPath)` `[42] :EndIf` `[43] :EndIf`
`#.Conga.asAv — 100%↟↑`
`asAv←{⎕AV[(⎕NXLATE 0)⍳¯1+⎕AV⍳⍵]}`
`#.Conga.cflate — 100%↟↑`
Could not get canonical representation.
`#.Conga.defaults — 100%↟↑`
`defaults←{⍺,(⍴,⍺)↓⍵}`
`#.Conga.enc — 100%↟↑`
`enc←{(326≠⎕DR ⍵)∧1=≡⍵:,⊂⍵ ⋄ ⍵}`
`#.Conga.ncase — 100%↟↑`
`ncase←{(lcase ⍺)⍺⍺(lcase ⍵)}`
`#.Conga.DefaultXlate — 100%↟↑`
`r←DefaultXlate` `[1] ⍝ Retrieve Default translate tables for Dyalog APL` `[2]` `[3] ⎕IO←0` `[4] x1←⎕NXLATE 0` `[5] x2←x1⍳⍳⍴x1` `[6]` `[7] r←'DYA_IN' 'ASCII'(⎕AV[x1])(⎕AV[x2])`
`#.Conga.ErrorText — 100%↟↑`
Could not get canonical representation.
`#.Conga.GetXlate — 100%↟↑`
Could not get canonical representation.
`#.Conga.KickStart — 100%↟↑`
Could not get canonical representation.
`#.Conga.Magic — 100%↟↑`
`Magic←{256⊥256|⎕UCS⍣((10|⎕DR ⍵)∊0 2)⊢4↑⍵}`
`#.Conga.Micros — 100%↟↑`
Could not get canonical representation.
`#.Conga.NetSize — 100%↟↑`
`NetSize←{,(4/256)⊤⍵}`
`#.Conga.SetXlate — 100%↟↑`
Could not get canonical representation.
`#.Conga.⍙CallR — 100%↟↑`
Could not get canonical representation.
`#.Conga.⍙CallRnt — 100%↟↑`
Could not get canonical representation.
`#.Conga.⍙CallRL — 100%↟↑`
Could not get canonical representation.
`#.Conga.⍙CallRLR — 100%↟↑`
Could not get canonical representation.
`#.Conga.⍙InitRPC — 100%↟↑`
Could not get canonical representation.
`#.Conga.⍙Version — 100%↟↑`
Could not get canonical representation.
`#.Conga.Client.enc — 100%↟↑`
Could not get canonical representation.
`#.Conga.Client.defaults — 100%↟↑`
Could not get canonical representation.
`#.Conga.Connection.onError — 100%↟↑`
`onError(obj data)` `[1] :Access Public Overridable` `[2] ⍝ ⎕←'Oh no ',obj,' has failed with error ',⍕data`
`#.Conga.Connection.onClose — 100%↟↑`
`onClose(obj data)` `[1] :Access Public Overridable` `[2] ⍝ ⎕←'Closed: ',⍕obj`
`#.Conga.Connection.enc — 100%↟↑`
Could not get canonical representation.
`#.Conga.Connection.defaults — 100%↟↑`
Could not get canonical representation.
`#.Conga.LIB.reparg — 100%↟↑`
`r←reparg a` `[1] arglist←'Name' 'Address' 'Port' 'Mode' 'BufferSize' 'SSLValidation' 'EOM' 'IgnoreCase' 'Protocol' 'PublicCertData' 'PrivateKeyFile' 'PrivateKeyPass' 'PublicCertFile' 'PublicCertPass' 'PrivateKeyData' 'X509'` `[2] ix←a getargix('X509' 'PublicCertData' 'PrivateKeyFile' 'PrivateKeyPass' 'PublicCertFile' 'PublicCertPass' 'PrivateKeyData')(arglist)` `[3] :If (⍴a)≥|⊃ix` `[4] cert←a getarg⊃ix` `[5]` `[6] :If 9=⎕NC'cert'` `[7] ⍝:AndIf 0<cert.IsCert ⍝Accept empty certificates.` `[8] a←(~(⍳⍴a)∊|ix)/a` `[9] a,←cert.AsArg` `[10] :EndIf` `[11] :EndIf` `[12] r←a`
`#.Conga.LIB.X509Cert — 100%↟↑`
`r←X509Cert` `[1] :Access Public Instance` `[2] r←##.Conga.X509Cert`
`#.Conga.LIB.UnMake — 100%↟↑`
`UnMake` `[1] :Implements Destructor` `[2] :Trap 0` `[3] _←Close'.'` `[4] :EndTrap`
`#.Conga.LIB.Srv — 100%↟↑`
`r←Srv a` `[1] :Access public` `[2] ⍝ Create a Server` `[3] ⍝ "Name", // string` `[4] ⍝ "Address", // string` `[5] ⍝ "Port", // Integer or service name` `[6] ⍝ "Mode", // command,raw,text` `[7] ⍝ "BufferSize",` `[8] ⍝ "SSLValidation", // integer` `[9] ⍝ "EOM", // Vector of stop strings` `[10] ⍝ "IgnoreCase", // boolean` `[11] ⍝ "Protocol", // ipv4,ipv6` `[12] ⍝ "PublicCertData",` `[13] ⍝ "PrivateKeyFile",` `[14] ⍝ "PrivateKeyPass",` `[15] ⍝ "PublicCertFile",` `[16] ⍝ "PublicCertPass",` `[17] ⍝ "PrivateKeyData'` `[18]` `[19] a←reparg a` `[20] r←check ##.Conga.⍙CallR RootName'ASrv'a 0`
`#.Conga.LIB.Send — 100%↟↑`
`r←Send a` `[1] :Access public` `[2] ⍝ Name data {CloseConnection}` `[3] ⎕IO←1` `[4] r←check ##.Conga.⍙CallRL RootName'ASendZ'((a,0)[1 3])(2⊃a)`
`#.Conga.LIB.Clt — 100%↟↑`
`r←Clt a` `[1] :Access public` `[2] ⍝ Create a Client` `[3] ⍝ "Name", // string` `[4] ⍝ "Address", // string` `[5] ⍝ "Port", // Integer or service name` `[6] ⍝ "Mode", // command,raw,text` `[7] ⍝ "BufferSize",` `[8] ⍝ "SSLValidation", // integer` `[9] ⍝ "EOM", // Vector of stop strings` `[10] ⍝ "IgnoreCase", // boolean` `[11] ⍝ "Protocol", // ipv4,ipv6` `[12] ⍝ "PublicCertData",` `[13] ⍝ "PrivateKeyFile",` `[14] ⍝ "PrivateKeyPass",` `[15] ⍝ "PublicCertFile",` `[16] ⍝ "PublicCertPass",` `[17] ⍝ "PrivateKeyData'` `[18]` `[19] a←reparg a` `[20] r←check ##.Conga.⍙CallR RootName'AClt'a 0`
`#.Conga.LIB.Close — 100%↟↑`
`r←Close con` `[1] :Access Public` `[2] ⍝ arg: Connection id` `[3]` `[4] r←check ##.Conga.⍙CallR RootName'AClose'con 0` `[5] ⍝ :If ((,'.')≡,con)∧(0<⎕NC'⍙naedfns') ⍝ Close root and unload share lib` `[6] ⍝ _←⎕EX¨⍙naedfns` `[7] ⍝ _←⎕EX'⍙naedfns'` `[8] ⍝ :EndIf`
`#.Conga.LIB.Certs — 100%↟↑`
`r←Certs a` `[1] :Access public` `[2] ⍝ Working with certificates.` `[3] ⍝ ListMSStores` `[4] ⍝ MSStore storename Issuer subject details api password` `[5] ⍝ Folder not implemented` `[6] ⍝ DER not implemented` `[7] ⍝ PK#12 not implemented` `[8] r←check ##.Conga.⍙CallR RootName'ACerts'a 0`
`#.Conga.LIB.Names — 100%↟↑`
`r←Names root` `[1] :Access public` `[2] ⍝ Return list of top level names` `[3]` `[4] :If 0=1↑r←Tree root` `[5] r←{0=⍴⍵:⍬ ⋄ (⊂1 1)⊃¨⍵}2 2⊃r` `[6] :EndIf`
`#.Conga.LIB.Respond — 100%↟↑`
`r←Respond a` `[1] :Access public` `[2] ⍝ cmd data` `[3] ⎕IO←1 ⋄ r←check ##.Conga.⍙CallRL RootName'ARespondZ'(a[1],1)(2⊃a)`
`#.Conga.LIB.SetProp — 100%↟↑`
`r←SetProp a` `[1] :Access public` `[2] ⍝ Name Prop Value` `[3] ⍝ '.' 'CertRootDir' 'c:\certfiles\ca'` `[4]` `[5] r←check ##.Conga.⍙CallR RootName'ASetProp'a 0`
`#.Conga.LIB.Tree — 100%↟↑`
`r←Tree a` `[1] :Access public` `[2] ⍝ Name` `[3] r←check ##.Conga.⍙CallR RootName'ATree'a 0`
`#.Conga.LIB.GetProp — 100%↟↑`
`r←GetProp a` `[1] :Access public` `[2] ⍝ Name Prop` `[3] ⍝ Root: DefaultProtocol PropList ReadyStrategy RootCertDir` `[4] ⍝ Server: OwnCert LocalAddr PropList` `[5] ⍝ Connection: OwnCert PeerCert LocalAddr PeerAddr PropList` `[6]` `[7] r←check ##.Conga.⍙CallR RootName'AGetProp'a 0` `[8]` `[9] :If 0=⊃r` `[10] :AndIf ∨/'OwnCert' 'PeerCert'∊a[2]` `[11] :AndIf 0<⊃⍴2⊃r` `[12] (2⊃r)←SetParentCerts{##.⎕NEW X509Cert(,⊂⍵)}¨2⊃r` `[13] :EndIf`
`#.Conga.LIB.Decode — 100%↟↑`
`r←base Decode code` `[1] ix←¯1+base⍳code` `[2]` `[3] bits←,⍉((2⍟⍴base)⍴2)⊤ix` `[4] size←{(⌊(¯1+⍺+⊃⍴⍵)÷⍺),⍺}` `[5]` `[6] s←8 size bits` `[7]` `[8] r←(8⍴2)⊥⍉s⍴(×/s)↑bits` `[9] r←(-0=¯1↑r)↓r`
`#.Conga.LIB.enum — 100%↟↑`
Could not get canonical representation.
`#.Conga.LIB.size — 100%↟↑`
Could not get canonical representation.
`#.Conga.X509Cert.set_Cert — 100%↟↑`
`set_Cert args` `[1] _Cert←args.NewValue` `[2] z←⎕EX¨'_Elements' '_Formatted' '_Extended' 'DecodeOK'`
`#.Conga.X509Cert.get_Cert — 100%↟↑`
`r←get_Cert args` `[1] r←_Cert`
`#.Conga.X509Cert.set_KeyOrigin — 100%↟↑`
`set_KeyOrigin args` `[1] _KeyOrigin←args.NewValue`
`#.Conga.X509Cert.set_Elements,Formatted,Extended — 100%↟↑`
Could not get canonical representation.
`#.Conga.X509Cert.get_Elements,Formatted,Extended — 100%↟↑`
Could not get canonical representation.
`#.Conga.X509Cert.Make1 — 100%↟↑`
`Make1 cert` `[1] :Access Public` `[2] :Implements Constructor` `[3]` `[4] :If 1≠≡cert ⋄ cert←1⊃cert ⋄ :EndIf` `[5] Cert←cert` `[6] _usemsstoreapi←0` `[7] _CertOrigin←_Key←_KeyOrigin←''` `[8] LDRC←FindDRC''`
`#.Conga.X509Cert.split — 100%↟↑`
Could not get canonical representation.
`#.Conga.X509Cert.fixpath — 100%↟↑`
Could not get canonical representation.
`#.Conga.X509Cert.size — 100%↟↑`
Could not get canonical representation.