Ejemplo n.º 1
0
 public byte[] EncodeX509KeyUsageExtension(X509KeyUsageFlags keyUsages)
 {
     unsafe
     {
         ushort         keyUsagesAsShort = (ushort)keyUsages;
         CRYPT_BIT_BLOB blob             = new CRYPT_BIT_BLOB()
         {
             cbData      = 2,
             pbData      = (byte *)&keyUsagesAsShort,
             cUnusedBits = 0,
         };
         return(Interop.crypt32.EncodeObject(CryptDecodeObjectStructType.X509_KEY_USAGE, &blob));
     }
 }
Ejemplo n.º 2
0
 internal CMSG_CTRL_KEY_AGREE_DECRYPT_PARA(int size) {
     cbSize = (uint) size;
     hCryptProv = IntPtr.Zero;
     dwKeySpec = 0;
     pKeyAgree = IntPtr.Zero;
     dwRecipientIndex = 0;
     dwRecipientEncryptedKeyIndex = 0;
     OriginatorPublicKey = new CRYPT_BIT_BLOB();
 }