AppendEncryptedSecurityData (Stringlist subroutine): Difference between revisions
m (→See also) |
m (→See also: add method to list) |
||
(12 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
{{Template:Stringlist:AppendEncryptedSecurityData subtitle}} | {{Template:Stringlist:AppendEncryptedSecurityData subtitle}} | ||
This subroutine RC4-encrypts a <var>Stringlist</var> that contains a base64 encoded, SSL-certificate related item (certificate request, certificate, private key, etc.). | This subroutine RC4-encrypts a <var>Stringlist</var> that contains a base64 encoded, SSL-certificate related item (certificate request, certificate, private key, etc.). | ||
Line 28: | Line 27: | ||
==Examples== | ==Examples== | ||
In the following example, the <code>%creq</code> <var>Stringlist</var> is loaded with a base64 encoded SSL certificate request, which is then RC4-encrypted and added to <var>Stringlist</var> <code>%sl</code> by the <var>AppendEncryptedSecurityData</var> method. The encrypted contents are then printed: <p class="code"> ... | In the following example, the <code>%creq</code> <var>Stringlist</var> is loaded with a base64 encoded SSL certificate request, which is then RC4-encrypted and added to <var>Stringlist</var> <code>%sl</code> by the <var>AppendEncryptedSecurityData</var> method. The encrypted contents are then printed: <p class="code">... | ||
text to %creq = new raw | text to %creq = new raw | ||
-----BEGIN NEW CERTIFICATE REQUEST----- | -----BEGIN NEW CERTIFICATE REQUEST----- | ||
Line 42: | Line 41: | ||
%sl:APPENDENCRYPTEDSECURITYDATA(%creq, Password='12345', Identifier='NEW CERTIFICATE REQUEST') | %sl:APPENDENCRYPTEDSECURITYDATA(%creq, Password='12345', Identifier='NEW CERTIFICATE REQUEST') | ||
%sl:print | %sl:print | ||
... | |||
</p> | |||
The result is shown below: | The result is shown below: | ||
Line 58: | Line 58: | ||
==See also== | ==See also== | ||
<p> | |||
<var>Stringlist</var> methods: </p> | |||
{{Template:Stringlist crypto methods}} | |||
<p> | |||
<var>String</var> methods:</p> | |||
<ul> | <ul> | ||
<li><var>[[ | <li><var>[[CertificateRequest (String function)|CertificateRequest]]</var> </li> | ||
<li><var>[[ | |||
<li><var>[[ | <li><var>[[SignedCertificate (String function)|SignedCertificate]]</var> </li> | ||
<li><var>[[ | |||
<li> | <li><var>[[SignedClientCertificate (String function)|SignedClientCertificate]]</var> </li> | ||
<li><var>[[ | |||
<li><var>[[ | <li><var>[[DerToXmlDoc (String function)|DerToXmlDoc]]</var> </li> | ||
<li><var>[[ | |||
<li><var>[[RSAPrivateKeyToXmlDoc (String function)|RSAPrivateKeyToXmlDoc]]</var></li> | |||
<li><var>[[X509CertificateToXmlDoc (String function)|X509CertificateToXmlDoc]]</var> </li> | |||
<li><var>[[X509CrlToXmlDoc (String function)|X509CrlToXmlDoc]]</var> </li> | |||
<li><var>[[ | <li>Multiple cryptographic cipher methods </li> | ||
<li><var>[[ | </ul> | ||
<li>[[ | <p> | ||
<var>System</var> methods: </p> | |||
<ul> | |||
<li><var>[[ClientCertificate (System function)|ClientCertificate]]</var> </li><li><var>[[GeneratedPrivateKey (System function)|GeneratedPrivateKey]]</var> </li> | |||
</ul> | |||
<p> | |||
<var>Socket</var> methods: </p> | |||
<ul> | |||
<li><var>[[Certificate (Socket function)|Certificate]]</var> </li> | |||
</ul> | </ul> | ||
{{Template:Stringlist:AppendEncryptedSecurityData footer}} | {{Template:Stringlist:AppendEncryptedSecurityData footer}} |
Latest revision as of 15:12, 6 September 2018
Add RC4 encrypted base64 data to a Stringlist (Stringlist class)
[Requires Janus Network Security]
This subroutine RC4-encrypts a Stringlist that contains a base64 encoded, SSL-certificate related item (certificate request, certificate, private key, etc.).
Syntax
sl:AppendEncryptedSecurityData( sl, [Password=] string, - [[Identifier=] string])
Syntax terms
sl | A Stringlist object to contain the encrypted, base64 data. |
---|---|
sl | A Stringlist object that contains unencrypted, base64 data. |
Password | This name allowed parameter is a string that contains a password (encryption key) to seed the RC4 algorithm. This value must be at least five characters long. |
Identifier | This optional, name allowed, parameter is a string that is part of a data-identifying text at the beginning and end of the base64 data to be encrypted. The text is in the form -----BEGIN string----- and -----END string----- , where the default for string is RSA PRIVATE KEY . Some other string replacements, for example, include X509 CERTIFICATE , and X509 CRL .
This is a case-sensitive, value; if it does not match the first and last items of data within sl, no data is returned to the method object, sl. |
Usage notes
- The length of the encrypted data matches the length of the unencrypted data.
Examples
In the following example, the %creq
Stringlist is loaded with a base64 encoded SSL certificate request, which is then RC4-encrypted and added to Stringlist %sl
by the AppendEncryptedSecurityData method. The encrypted contents are then printed:
... text to %creq = new raw -----BEGIN NEW CERTIFICATE REQUEST----- MIIBSDCB8wIBADCBjzEMMAoGA1UEBhMDVVNBMQswCQYDVQQIEwJNQTESMBAGA1UE BxMJQ2FtYnJpZGdlMR0wGwYDVQQKExRTaXJpdXMgU29mdHdhcmUgSW5jLjEdMBsG A1UECxMUU29mdHdhcmUgRGV2ZWxvcG1lbnQxIDAeBgNVBAMTF3d3dy5zaXJpdXMt c29mdHdhcmUuY29tMFowDQYJKoZIhvcNAQEBBQADSQAwRgJBAMIofDUItsJLIREb 8UJ93Xm3sJRkYI9qus6lPj76iGOLoQEExSVMved24YxtBlC84IPQrl1+foNcFYSv OAnfA0ECAQOgADANBgkqhkiG9w0BAQQFAANBAFY6cU6+8p2E9xejVNACmQx2quSV rudOnjS3jGeKl4Ga/wqg3Yrvg5BwMAWxGn1reh7DhX9j/ScjuBWVIgBkU9M= -----END NEW CERTIFICATE REQUEST----- end text %sl:APPENDENCRYPTEDSECURITYDATA(%creq, Password='12345', Identifier='NEW CERTIFICATE REQUEST') %sl:print ...
The result is shown below:
-----BEGIN NEW CERTIFICATE REQUEST----- mzU3hcc5C0PhBbRWKhFeysu/SEn1oNSuv8tldCRTgQGSSx/9WQIarg9Q60gYqoVP lNivlNniqBLnw69pf4bdsg+Nhb+t2SBImuQ6Ar9eCMqNQa1Lfa0IAf/akuIqDdMa 8N5aIIwTIlDuy0P4agbLZg1tG5oUKTbfcCgEibAfNm+qKazxV0G39s4SGFW+Turf 68byY3fPD1kumMAPJBUCgvLf5iI+ayOSH5K6hQJtCAInXmG+DnqHfnUgS9F80Jcb /BzgIFktn/GV1POVX5VXZxQWDFzYXIVZJkyflsLdl1qWuAeXmwEHZRXy9yIxDc0R zTxxOmI18406SojaHK7HUN9UcCrlT1BWsbBsuD81eWw7FpAImI/z3sAfqg37cEgp Df75M4koUrT8wD6SHSx9ezII0GPaiAr1EUTzATRSoq6hoWS/TrpvE2STOyI= -----END NEW CERTIFICATE REQUEST-----
See also
Stringlist methods:
- AppendCertificateInfo
- AppendCertificateRequest
- AppendCertificateRequestInfo
- AppendClientCertificateRequest
- AppendEncryptedSecurityData
- AppendGeneratedPrivateKey
- AppendPemData
- AppendPrivateKeyInfo
- AppendSignedCertificate
- AppendSignedClientCertificate
- CheckCertificate
- CheckCertificateRequest
- PemToString
String methods:
- CertificateRequest
- SignedCertificate
- SignedClientCertificate
- DerToXmlDoc
- RSAPrivateKeyToXmlDoc
- X509CertificateToXmlDoc
- X509CrlToXmlDoc
- Multiple cryptographic cipher methods
System methods:
Socket methods: