internal static byte[] BlobToByteArray(CAPIBase.CRYPTOAPI_BLOB blob) { if (blob.cbData == 0) { return new byte[0]; } byte[] destination = new byte[blob.cbData]; Marshal.Copy(blob.pbData, destination, 0, destination.Length); return destination; }
internal X500DistinguishedName(CAPIBase.CRYPTOAPI_BLOB encodedDistinguishedNameBlob) : base(new Oid(), encodedDistinguishedNameBlob) { }
internal AsnEncodedData(string oid, CAPIBase.CRYPTOAPI_BLOB encodedBlob) : this(oid, CAPI.BlobToByteArray(encodedBlob)) { }
internal CMSG_STREAM_INFO(uint cbContent, CAPIBase.PFN_CMSG_STREAM_OUTPUT pfnStreamOutput, IntPtr pvArg) { this.cbContent = cbContent; this.pfnStreamOutput = pfnStreamOutput; this.pvArg = pvArg; }
internal AsnEncodedData(System.Security.Cryptography.Oid oid, CAPIBase.CRYPTOAPI_BLOB encodedBlob) : this(oid, CAPI.BlobToByteArray(encodedBlob)) { }