Exemplo n.º 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());
         });
     }
 }
Exemplo n.º 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();
         }));
     }
 }
Exemplo n.º 3
0
 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;
     }
 }
Exemplo n.º 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);
            }
        }
Exemplo n.º 5
0
 public static unsafe partial bool CertSetCertificateContextProperty(SafeCertContextHandle pCertContext, CertContextPropId dwPropId, CertSetPropertyFlags dwFlags, CRYPTOAPI_BLOB *pvData);
Exemplo n.º 6
0
 public static extern unsafe bool CertSetCertificateContextProperty(SafeCertContextHandle pCertContext, CertContextPropId dwPropId, CertSetPropertyFlags dwFlags, [In] CRYPTOAPI_BLOB *pvData);