CryptoSys PKI Pro Manual

Using output in XML documents

You can create most of the cryptographic elements required in the [XML-DSIG] and [XML-ENC] specifications to insert into XML documents. These XML values should be encoded in base64 encoding. Use CNV_B64StrFromBytes or Cnv.ToBase64 to convert byte arrays into base64 encoding.

Here is a selection of some elements you can create.

SignatureValue element

Use Sig.SignData or Sig.SignFile.

Alternatively, use Rsa.EncodeMsgForSignature followed by Rsa.RawPrivate then Cnv.ToBase64.

DigestValue element

Use Hash.BytesFromBytes or Hash.BytesFromFile then Cnv.ToBase64.

X509Certificate element

Use X509.ReadStringFromFile.

X509IssuerSerial element

Use X509.QueryCert with query "serialNumber" and X509.OutputOpts.Decimal.

X509SubjectName element

Use X509.QueryCert with query "subjectName" and X509.OutputOpts.Ldap.

RSAKeyValue element

Use Rsa.KeyValue or Rsa.ToXMLString.

RSAKeyPair element

Use Rsa.ToXMLString.

CipherValue element

xmlenc#rsa-1_5: Use Rsa.EncodeMsgForEncryption with Rsa.EME.PKCSv1_5 option followed by Rsa.RawPublic then Cnv.ToBase64

xmlenc#rsa-oaep-mgf1p: As for xmlenc#rsa-1_5 except use Rsa.EME.OAEP option.

xmlenc#tripledes-cbc: Use Cipher.Encrypt with options CipherAlgorithm.Tdea, Mode.CBC and padding.Pkcs5, then Cnv.ToBase64.

xmlenc#aes128-cbc: As for xmlenc#tripledes-cbc except use CipherAlgorithm.Aes128 option.

xmlenc#aes192-cbc: As for xmlenc#tripledes-cbc except use CipherAlgorithm.Aes192 option.

xmlenc#aes256-cbc: As for xmlenc#tripledes-cbc except use CipherAlgorithm.Aes256 option.

[Contents] [Index]

[PREV: Using in MIME-conformant email messages...]   [Contents]   [Index]   
   [NEXT: Base64url encoding and JSON Web Signatures (JWS)...]

Copyright © 2004-24 D.I. Management Services Pty Ltd. All rights reserved. Generated 2024-09-23T07:52:09Z.