Esempio n. 1
0
 internal KeyAgreeRecipientInfo(SafeLocalAllocHandle pRecipientInfo, CAPI.CMSG_KEY_AGREE_PUBLIC_KEY_RECIPIENT_INFO publicKeyRecipient, uint index, uint subIndex) : base(RecipientInfoType.KeyAgreement, RecipientSubType.PublicKeyAgreement, pRecipientInfo, publicKeyRecipient, index)
 {
     checked {
         IntPtr pEncryptedKeyInfo = Marshal.ReadIntPtr(new IntPtr((long)publicKeyRecipient.rgpRecipientEncryptedKeys + (long)(subIndex * Marshal.SizeOf(typeof(IntPtr)))));
         CAPI.CMSG_RECIPIENT_ENCRYPTED_KEY_INFO encryptedKeyInfo = (CAPI.CMSG_RECIPIENT_ENCRYPTED_KEY_INFO)Marshal.PtrToStructure(pEncryptedKeyInfo, typeof(CAPI.CMSG_RECIPIENT_ENCRYPTED_KEY_INFO));
         Reset(CAPI.CMSG_KEY_AGREE_ORIGINATOR_PUBLIC_KEY, publicKeyRecipient.dwVersion, encryptedKeyInfo, subIndex);
     }
 }
Esempio n. 2
0
        //
        // Private methods.
        //

        private void Reset(uint originatorChoice, uint version, CAPI.CMSG_RECIPIENT_ENCRYPTED_KEY_INFO encryptedKeyInfo, uint subIndex)
        {
            m_encryptedKeyInfo     = encryptedKeyInfo;
            m_originatorChoice     = originatorChoice;
            m_version              = (int)version;
            m_originatorIdentifier = null;
            m_userKeyMaterial      = new byte[0];
            m_encryptionAlgorithm  = null;
            m_recipientIdentifier  = null;
            m_encryptedKey         = new byte[0];
            m_date = DateTime.MinValue;
            m_otherKeyAttribute = null;
            m_subIndex          = subIndex;
        }
Esempio n. 3
0
 private void Reset(uint originatorChoice, uint version, CAPI.CMSG_RECIPIENT_ENCRYPTED_KEY_INFO encryptedKeyInfo, uint subIndex)
 {
     this.m_encryptedKeyInfo     = encryptedKeyInfo;
     this.m_originatorChoice     = originatorChoice;
     this.m_version              = (int)version;
     this.m_originatorIdentifier = (SubjectIdentifierOrKey)null;
     this.m_userKeyMaterial      = new byte[0];
     this.m_encryptionAlgorithm  = (AlgorithmIdentifier)null;
     this.m_recipientIdentifier  = (SubjectIdentifier)null;
     this.m_encryptedKey         = new byte[0];
     this.m_date = DateTime.MinValue;
     this.m_otherKeyAttribute = (CryptographicAttributeObject)null;
     this.m_subIndex          = subIndex;
 }
Esempio n. 4
0
 private void Reset(uint originatorChoice, uint version, CAPI.CMSG_RECIPIENT_ENCRYPTED_KEY_INFO encryptedKeyInfo, uint subIndex)
 {
     this.m_encryptedKeyInfo = encryptedKeyInfo;
     this.m_originatorChoice = originatorChoice;
     this.m_version = (int)version;
     this.m_originatorIdentifier = (SubjectIdentifierOrKey)null;
     this.m_userKeyMaterial = new byte[0];
     this.m_encryptionAlgorithm = (AlgorithmIdentifier)null;
     this.m_recipientIdentifier = (SubjectIdentifier)null;
     this.m_encryptedKey = new byte[0];
     this.m_date = DateTime.MinValue;
     this.m_otherKeyAttribute = (CryptographicAttributeObject)null;
     this.m_subIndex = subIndex;
 }
Esempio n. 5
0
 internal KeyAgreeRecipientInfo(SafeLocalAllocHandle pRecipientInfo, CAPI.CMSG_KEY_AGREE_PUBLIC_KEY_RECIPIENT_INFO publicKeyRecipient, uint index, uint subIndex)
     : base(RecipientInfoType.KeyAgreement, RecipientSubType.PublicKeyAgreement, pRecipientInfo, (object)publicKeyRecipient, index)
 {
     CAPI.CMSG_RECIPIENT_ENCRYPTED_KEY_INFO encryptedKeyInfo = (CAPI.CMSG_RECIPIENT_ENCRYPTED_KEY_INFO)Marshal.PtrToStructure(Marshal.ReadIntPtr(new IntPtr((long)publicKeyRecipient.rgpRecipientEncryptedKeys + (long)subIndex * (long)Marshal.SizeOf(typeof(IntPtr)))), typeof(CAPI.CMSG_RECIPIENT_ENCRYPTED_KEY_INFO));
     this.Reset(2U, publicKeyRecipient.dwVersion, encryptedKeyInfo, subIndex);
 }