示例#1
0
 public void DecodeX509SubjectKeyIdentifierExtension(byte[] encoded, out byte[] subjectKeyIdentifier)
 {
     unsafe
     {
         subjectKeyIdentifier = encoded.DecodeObject(
             Oids.SubjectKeyIdentifier,
             static delegate(void *pvDecoded, int cbDecoded)
         {
             Debug.Assert(cbDecoded >= sizeof(CRYPTOAPI_BLOB));
             CRYPTOAPI_BLOB *pBlob = (CRYPTOAPI_BLOB *)pvDecoded;
             return(pBlob->ToByteArray());
         });
     }
 }
示例#2
0
 private static byte[]? DecodeDssKeyValue(byte[] encodedKeyValue)
 {
     unsafe
     {
         return(encodedKeyValue.DecodeObject(
                    CryptDecodeObjectStructType.X509_DSS_PUBLICKEY,
                    static delegate(void *pvDecoded, int cbDecoded)
         {
             Debug.Assert(cbDecoded >= sizeof(CRYPTOAPI_BLOB));
             CRYPTOAPI_BLOB *pBlob = (CRYPTOAPI_BLOB *)pvDecoded;
             return pBlob->ToByteArray();
         }));
     }
 }
 public void DecodeX509SubjectKeyIdentifierExtension(byte[] encoded, out byte[] subjectKeyIdentifier)
 {
     unsafe
     {
         byte[] localSubjectKeyIdentifier = null;
         encoded.DecodeObject(
             Oids.SubjectKeyIdentifier,
             delegate(void *pvDecoded)
         {
             CRYPTOAPI_BLOB *pBlob     = (CRYPTOAPI_BLOB *)pvDecoded;
             localSubjectKeyIdentifier = pBlob->ToByteArray();
         }
             );
         subjectKeyIdentifier = localSubjectKeyIdentifier;
     }
 }
示例#4
0
        private static byte[] DecodeDssKeyValue(byte[] encodedKeyValue)
        {
            unsafe
            {
                byte[] decodedKeyValue = null;

                encodedKeyValue.DecodeObject(
                    CryptDecodeObjectStructType.X509_DSS_PUBLICKEY,
                    delegate(void *pvDecoded)
                {
                    CRYPTOAPI_BLOB *pBlob = (CRYPTOAPI_BLOB *)pvDecoded;
                    decodedKeyValue       = pBlob->ToByteArray();
                }
                    );

                return(decodedKeyValue);
            }
        }
示例#5
0
 public static unsafe partial bool CertSetCertificateContextProperty(SafeCertContextHandle pCertContext, CertContextPropId dwPropId, CertSetPropertyFlags dwFlags, CRYPTOAPI_BLOB *pvData);
示例#6
0
 public static extern unsafe bool CertSetCertificateContextProperty(SafeCertContextHandle pCertContext, CertContextPropId dwPropId, CertSetPropertyFlags dwFlags, [In] CRYPTOAPI_BLOB *pvData);