Net.Pkcs11Interop.HighLevelAPI81.Session.DecryptVerify C# (CSharp) Method

DecryptVerify() public method

Decrypts data and verifies a signature of data
public DecryptVerify ( Mechanism verificationMechanism, ObjectHandle verificationKeyHandle, Mechanism decryptionMechanism, ObjectHandle decryptionKeyHandle, byte data, byte signature, byte &decryptedData, bool &isValid ) : void
verificationMechanism Mechanism Verification mechanism
verificationKeyHandle ObjectHandle Handle of the verification key
decryptionMechanism Mechanism Decryption mechanism
decryptionKeyHandle ObjectHandle Handle of the decryption key
data byte Data to be processed
signature byte Signature
decryptedData byte Decrypted data
isValid bool Flag indicating whether signature is valid
return void
        public void DecryptVerify(Mechanism verificationMechanism, ObjectHandle verificationKeyHandle, Mechanism decryptionMechanism, ObjectHandle decryptionKeyHandle, byte[] data, byte[] signature, out byte[] decryptedData, out bool isValid)
        {
            if (this._disposed)
                throw new ObjectDisposedException(this.GetType().FullName);

            if (verificationMechanism == null)
                throw new ArgumentNullException("verificationMechanism");
            
            if (verificationKeyHandle == null)
                throw new ArgumentNullException("verificationKeyHandle");
            
            if (decryptionMechanism == null)
                throw new ArgumentNullException("decryptionMechanism");
            
            if (decryptionKeyHandle == null)
                throw new ArgumentNullException("decryptionKeyHandle");

            if (data == null)
                throw new ArgumentNullException("data");
            
            if (signature == null)
                throw new ArgumentNullException("signature");

            using (MemoryStream inputMemoryStream = new MemoryStream(data), outputMemorySteam = new MemoryStream())
            {
                DecryptVerify(verificationMechanism, verificationKeyHandle, decryptionMechanism, decryptionKeyHandle, inputMemoryStream, outputMemorySteam, signature, out isValid);
                decryptedData = outputMemorySteam.ToArray();
            }
        }

Same methods

Session::DecryptVerify ( Mechanism verificationMechanism, ObjectHandle verificationKeyHandle, Mechanism decryptionMechanism, ObjectHandle decryptionKeyHandle, Stream inputStream, Stream outputStream, byte signature, bool &isValid ) : void
Session::DecryptVerify ( Mechanism verificationMechanism, ObjectHandle verificationKeyHandle, Mechanism decryptionMechanism, ObjectHandle decryptionKeyHandle, Stream inputStream, Stream outputStream, byte signature, bool &isValid, int bufferLength ) : void