UniBasic Commands Reference - Rocket Software
UniBasic Commands Reference - Rocket Software UniBasic Commands Reference - Rocket Software
setPrivateKey Syntax setPrivateKey(key, format, keyLoc, passPhrase, validate, context) Note: This function is case-sensitive. If you want it to be case-insensitive, you must compile your programs using the BASIC command with the -i option. Description The setPrivateKey() function loads the private key into a security context so that it can be used by SSL functions. If the context already had a set private key, it will be replaced. SSL depends on public key crypto algorithms to perform its functions. A pair of keys is needed for each communicating party to transfer data over SSL The public key is usually contained in a certificate, signed by a CA, while the private key is kept secretly by the user. Private key is used to digitally sign a message or encrypt a symmetric secret key to be used for data encryption. For detailed information about the setPrivateKey function, see UniBasic Extensions. Parameters The following table describes each parameter of the syntax. Parameter Description 1-730 UniBasic Commands Reference Key A string containing either the key or path for a key file. Format 1 - PEM (Base64 encoded) format 2 - DER (ASN.1 binary) format KeyLoc 1 - key contained in key string 2 - key is in a file specified by key setPrivateKey Parameters
Parameter Description passPhrase String containing the path phrase required for gaining access to the key. It can be empty if the key is not pass phrase protected. THIS IS NOT RECOMMENDED! Validate 1 - Validate against matching public key 0 - Will not bother to validate Context The security context handle. The following table describes the status of each return code. Return Code Status 0 Success 1 Invalid Security handle 2 Invalid format setPrivateKey Parameters (continued) 3 Invalid key type 4 Key file cannot be accessed (non-existent or wrong pass phrase) 5 Certificate cannot be accessed 6 Private key does not match public key in certificate 7 Private key cannot be interpreted 99 Other errors that prevent private key from being accepted by UniData or UniVerse. setPrivateKey Return Codes setPrivateKey 1-731
- Page 722 and 723: REMOVE Syntax REMOVE(dyn.array.var,
- Page 724 and 725: REPLACE Syntax REPLACE(dyn.array.ex
- Page 726 and 727: In the next example, the program se
- Page 728 and 729: RESIZET Syntax RESIZET [UNIT(mu.exp
- Page 730 and 731: RETURN Syntax RETURN [TO label[:]]
- Page 732 and 733: Examples In the following example,
- Page 734 and 735: Example In the following example, t
- Page 736 and 737: RNDSEED Syntax RNDSEED expr Descrip
- Page 738 and 739: SADD Syntax SADD(x, y) Description
- Page 740 and 741: The following table describes the s
- Page 742 and 743: Example In the following example, t
- Page 744 and 745: SELECT Syntax SELECT file.var [TO {
- Page 746 and 747: Examples The following program segm
- Page 748 and 749: SELECTINDEX Syntax SELECTINDEX inde
- Page 750 and 751: Related Commands UniBasic DELETELIS
- Page 752 and 753: Related Commands UniBasic DELETELIS
- Page 754 and 755: Note: SEND with the X option suppre
- Page 756 and 757: SEQS Syntax SEQS("char.expr") Descr
- Page 758 and 759: The following table describes the s
- Page 760 and 761: Parameters The following table desc
- Page 762 and 763: The following table describes the s
- Page 764 and 765: setHTTPDefault Syntax setHTTPDefaul
- Page 766 and 767: The following table describes the s
- Page 768 and 769: Parameters The following table desc
- Page 770 and 771: Examples In the following example,
- Page 774 and 775: setRandomSeed Syntax setRandomSeed(
- Page 776 and 777: setRequestHeader Syntax setRequestH
- Page 778 and 779: setSocketOptions Syntax setSocketOp
- Page 780 and 781: showSecurityContext Syntax showSecu
- Page 782 and 783: SIGNATURE Syntax SIGNATURE(algorith
- Page 784 and 785: Return Code Status 1-742 UniBasic C
- Page 786 and 787: SLEEP Syntax SLEEP [hh:mm[:ss]] [se
- Page 788 and 789: SMUL Syntax SMUL(x, y) Description
- Page 790 and 791: Return Codes The return code indica
- Page 792 and 793: The following table describes each
- Page 794 and 795: SOAPGetDefault Syntax SOAPGetDefaul
- Page 796 and 797: SOAPGetFault Syntax SOAPGetFault(re
- Page 798 and 799: SOAPGetResponseHeader Syntax SOAPGe
- Page 800 and 801: SOAPRequestWrite Syntax SOAPRequest
- Page 802 and 803: SOAPSetDefault Syntax SOAPSetDefaul
- Page 804 and 805: Along with SOAPSetDefault, the Call
- Page 806 and 807: Return Codes The return code indica
- Page 808 and 809: Return Codes The return code indica
- Page 810 and 811: Return Codes The return code indica
- Page 812 and 813: You can also use the UniBasic STATU
- Page 814 and 815: Return Codes The return code indica
- Page 816 and 817: SOUNDEX Syntax SOUNDEX(expr) Descri
- Page 818 and 819: SPACE Syntax SPACE(expr) Descriptio
- Page 820 and 821: SPLICE Syntax SPLICE(expr1,"expr",
Parameter Description<br />
passPhrase String containing the path phrase required for gaining access to the key.<br />
It can be empty if the key is not pass phrase protected. THIS IS NOT<br />
RECOMMENDED!<br />
Validate 1 - Validate against matching public key<br />
0 - Will not bother to validate<br />
Context The security context handle.<br />
The following table describes the status of each return code.<br />
Return<br />
Code Status<br />
0 Success<br />
1 Invalid Security handle<br />
2 Invalid format<br />
setPrivateKey Parameters (continued)<br />
3 Invalid key type<br />
4 Key file cannot be accessed (non-existent or wrong pass phrase)<br />
5 Certificate cannot be accessed<br />
6 Private key does not match public key in certificate<br />
7 Private key cannot be interpreted<br />
99 Other errors that prevent private key from being accepted by<br />
UniData or UniVerse.<br />
setPrivateKey Return Codes<br />
setPrivateKey 1-731