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

DigestEncrypt() public method

Digests and encrypts data
public DigestEncrypt ( Mechanism digestingMechanism, Mechanism encryptionMechanism, ObjectHandle keyHandle, Stream inputStream, Stream outputStream ) : byte[]
digestingMechanism Mechanism Digesting mechanism
encryptionMechanism Mechanism Encryption mechanism
keyHandle ObjectHandle Handle of the encryption key
inputStream Stream Input stream from which data to be processed should be read
outputStream Stream Output stream where encrypted data should be written
return byte[]
        public byte[] DigestEncrypt(Mechanism digestingMechanism, Mechanism encryptionMechanism, ObjectHandle keyHandle, Stream inputStream, Stream outputStream)
        {
            if (this._disposed)
                throw new ObjectDisposedException(this.GetType().FullName);

            if (digestingMechanism == null)
                throw new ArgumentNullException("digestingMechanism");
            
            if (encryptionMechanism == null)
                throw new ArgumentNullException("encryptionMechanism");
            
            if (keyHandle == null)
                throw new ArgumentNullException("keyHandle");
            
            if (inputStream == null)
                throw new ArgumentNullException("inputStream");

            if (outputStream == null)
                throw new ArgumentNullException("outputStream");

            return DigestEncrypt(digestingMechanism, encryptionMechanism, keyHandle, inputStream, outputStream, 4096);
        }

Same methods

Session::DigestEncrypt ( Mechanism digestingMechanism, Mechanism encryptionMechanism, ObjectHandle keyHandle, Stream inputStream, Stream outputStream, int bufferLength ) : byte[]
Session::DigestEncrypt ( Mechanism digestingMechanism, Mechanism encryptionMechanism, ObjectHandle keyHandle, byte data, byte &digest, byte &encryptedData ) : void