Cryptographic​Engine Cryptographic​Engine Cryptographic​Engine Class

Definition

Encrypts, decrypts, and signs content, and verifies digital signatures.

public static class CryptographicEnginepublic static class CryptographicEnginePublic Static Class CryptographicEngine
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

This class contains only static methods. You do not have to create an instance of the class to use the methods. Instead, use the class name followed by the dot operator (.), followed by the method name.

Methods

Decrypt(CryptographicKey, IBuffer, IBuffer) Decrypt(CryptographicKey, IBuffer, IBuffer) Decrypt(CryptographicKey, IBuffer, IBuffer)

Decrypts content that was previously encrypted by using a symmetric or asymmetric algorithm.

public static IBuffer Decrypt(CryptographicKey key, IBuffer data, IBuffer iv)public static IBuffer Decrypt(CryptographicKey key, IBuffer data, IBuffer iv)Public Static Function Decrypt(key As CryptographicKey, data As IBuffer, iv As IBuffer) As IBuffer
Parameters
key
CryptographicKey CryptographicKey CryptographicKey

Cryptographic key to use for decryption. This can be an asymmetric or a symmetric key. For more information, see AsymmetricKeyAlgorithmProvider and SymmetricKeyAlgorithmProvider.

data
IBuffer IBuffer IBuffer

Buffer that contains the encrypted data.

iv
IBuffer IBuffer IBuffer

Buffer that contains the initialization vector. If an initialization vector (IV) was used to encrypt the data, you must use the same IV to decrypt the data. For more information, see Encrypt.

Returns

Decrypted data.

Attributes

Remarks

The key parameter can be a persisted key obtained from a certificate using the PersistedKeyProvider class.

If the key is a persisted key and the decrypt operation requires UI or takes a long time, use the DecryptAsync method instead. For example, UI is required when decrypting using a key that is strongly protected. In the case where a persisted key is used and UI is expected, use the DecryptAsync method as the Decrypt method will fail.

Examples

public void SampleCipherDecryption(
    String strAlgName,
    IBuffer buffEncrypt,
    IBuffer iv,
    BinaryStringEncoding encoding,
    CryptographicKey key)
{
    // Declare a buffer to contain the decrypted data.
    IBuffer buffDecrypted;

    // Open an symmetric algorithm provider for the specified algorithm. 
    SymmetricKeyAlgorithmProvider objAlg = SymmetricKeyAlgorithmProvider.OpenAlgorithm(strAlgName);

    // The input key must be securely shared between the sender of the encrypted message
    // and the recipient. The initialization vector must also be shared but does not
    // need to be shared in a secure manner. If the sender encodes a message string 
    // to a buffer, the binary encoding method must also be shared with the recipient.
    buffDecrypted = CryptographicEngine.Decrypt(key, buffEncrypt, iv);

    // Convert the decrypted buffer to a string (for display). If the sender created the
    // original message buffer from a string, the sender must tell the recipient what 
    // BinaryStringEncoding value was used. Here, BinaryStringEncoding.Utf8 is used to
    // convert the message to a buffer before encryption and to convert the decrypted
    // buffer back to the original plaintext.
    String strDecrypted = CryptographicBuffer.ConvertBinaryToString(encoding, buffDecrypted);
}

See Also

DecryptAndAuthenticate(CryptographicKey, IBuffer, IBuffer, IBuffer, IBuffer) DecryptAndAuthenticate(CryptographicKey, IBuffer, IBuffer, IBuffer, IBuffer) DecryptAndAuthenticate(CryptographicKey, IBuffer, IBuffer, IBuffer, IBuffer)

Decrypts and authenticates data. For more information and a complete code sample, see EncryptedAndAuthenticatedData.

public static IBuffer DecryptAndAuthenticate(CryptographicKey key, IBuffer data, IBuffer nonce, IBuffer authenticationTag, IBuffer authenticatedData)public static IBuffer DecryptAndAuthenticate(CryptographicKey key, IBuffer data, IBuffer nonce, IBuffer authenticationTag, IBuffer authenticatedData)Public Static Function DecryptAndAuthenticate(key As CryptographicKey, data As IBuffer, nonce As IBuffer, authenticationTag As IBuffer, authenticatedData As IBuffer) As IBuffer
Parameters
data
IBuffer IBuffer IBuffer

Data to be decrypted and authenticated.

nonce
IBuffer IBuffer IBuffer

Nonce to be used. This must be the same nonce used by the EncryptAndAuthenticate method.

authenticationTag
IBuffer IBuffer IBuffer

Authentication tag.

authenticatedData
IBuffer IBuffer IBuffer

Authenticated data. This can be Null.

Returns

A buffer that contains the decrypted data.If the method fails, authentication fails; if the method succeeds, the authentication succeeded as well.

Attributes

Remarks

Authenticated encryption encrypts and authenticates content in one operation. An authenticator, also called a tag, is used during encryption and the output of the process contains a tag-ciphertext pair. For more information, see the AuthenticationTag and EncryptedData properties. The decryption process verifies the ciphertext against the tag.

You can use an authenticated encryption algorithm after calling the OpenAlgorithm method on the SymmetricKeyAlgorithmProvider class and specifying the name of the algorithm to open. The following algorithm names are supported for authenticated encryption and decryption:

Examples

public void AuthenticatedDecryption(
    String strAlgName,
    CryptographicKey key,
    EncryptedAndAuthenticatedData objEncrypted,
    BinaryStringEncoding encoding,
    IBuffer buffNonce)
{
    // Declare a buffer to contain the decrypted data.
    IBuffer buffDecrypted;

    // Open a SymmetricKeyAlgorithmProvider object for the specified algorithm.
    SymmetricKeyAlgorithmProvider objAlgProv = SymmetricKeyAlgorithmProvider.OpenAlgorithm(strAlgName);

    // The input key must be securely shared between the sender of the encrypted message
    // and the recipient. The nonce must also be shared but does not need to be shared
    // in a secure manner. If the sender encodes the message string to a buffer, the
    // binary encoding method must also be shared with the recipient.
    // The recipient uses the DecryptAndAuthenticate() method as follows to decrypt the 
    // message, authenticate it, and verify that it has not been altered in transit.
    buffDecrypted = CryptographicEngine.DecryptAndAuthenticate(
        key,
        objEncrypted.EncryptedData,
        buffNonce,
        objEncrypted.AuthenticationTag,
        null);

    // Convert the decrypted buffer to a string (for display). If the sender created the
    // original message buffer from a string, the sender must tell the recipient what 
    // BinaryStringEncoding value was used. Here, BinaryStringEncoding.Utf8 is used to
    // convert the message to a buffer before encryption and to convert the decrypted
    // buffer back to the original plaintext.
    String strDecrypted = CryptographicBuffer.ConvertBinaryToString(encoding, buffDecrypted);

}

DecryptAsync(CryptographicKey, IBuffer, IBuffer) DecryptAsync(CryptographicKey, IBuffer, IBuffer) DecryptAsync(CryptographicKey, IBuffer, IBuffer)

Decrypts the encrypted input data using the supplied key.

public static IAsyncOperation<IBuffer> DecryptAsync(CryptographicKey key, IBuffer data, IBuffer iv)public static IAsyncOperation<IBuffer> DecryptAsync(CryptographicKey key, IBuffer data, IBuffer iv)Public Static Function DecryptAsync(key As CryptographicKey, data As IBuffer, iv As IBuffer) As IAsyncOperation( Of IBuffer )
Parameters
key
CryptographicKey CryptographicKey CryptographicKey

The key to use to decrypt the encrypted input data.

data
IBuffer IBuffer IBuffer

The encrypted data to decrypt.

iv
IBuffer IBuffer IBuffer

The initial vector for a symmetric key. For an asymmetric key, set this value to null.

Returns

The decrypted data.

Attributes

Remarks

If the key is a persisted key and the decrypt operation requires UI or takes a long time, use the DecryptAsync method instead of the Decrypt method. For example, UI is required when decrypting using a key that is strongly protected.

DeriveKeyMaterial(CryptographicKey, KeyDerivationParameters, UInt32) DeriveKeyMaterial(CryptographicKey, KeyDerivationParameters, UInt32) DeriveKeyMaterial(CryptographicKey, KeyDerivationParameters, UInt32)

Derives a key from another key by using a key derivation function. For more information, see the KeyDerivationAlgorithmProvider and KeyDerivationParameters classes.

public static IBuffer DeriveKeyMaterial(CryptographicKey key, KeyDerivationParameters parameters, UInt32 desiredKeySize)public static IBuffer DeriveKeyMaterial(CryptographicKey key, KeyDerivationParameters parameters, UInt32 desiredKeySize)Public Static Function DeriveKeyMaterial(key As CryptographicKey, parameters As KeyDerivationParameters, desiredKeySize As UInt32) As IBuffer
Parameters
key
CryptographicKey CryptographicKey CryptographicKey

The symmetric or secret key used for derivation.

parameters
KeyDerivationParameters KeyDerivationParameters KeyDerivationParameters

Derivation parameters. The parameters vary depending on the type of KDF algorithm used.

desiredKeySize
System.UInt32 System.UInt32 System.UInt32

Requested size, in bytes, of the derived key.

Returns

Buffer that contains the derived key.

Attributes

Remarks

Deriving keys requires that you use the KeyDerivationAlgorithmProvider and KeyDerivationParameters classes. The following key derivation functions can be used:

For a complete sample that contains the following code example, see the KeyDerivationAlgorithmProvider class.

Examples

public String SampleDeriveFromPbkdf(
    String strAlgName,
    UInt32 targetSize)
{
    // Open the specified algorithm.
    KeyDerivationAlgorithmProvider objKdfProv = KeyDerivationAlgorithmProvider.OpenAlgorithm(strAlgName);

    // Create a buffer that contains the secret used during derivation.
    String strSecret = "MyPassword";
    IBuffer buffSecret = CryptographicBuffer.ConvertStringToBinary(strSecret, BinaryStringEncoding.Utf8);

    // Create a random salt value.
    IBuffer buffSalt = CryptographicBuffer.GenerateRandom(32);

    // Specify the number of iterations to be used during derivation.
    UInt32 iterationCount = 10000;

    // Create the derivation parameters.
    KeyDerivationParameters pbkdf2Params = KeyDerivationParameters.BuildForPbkdf2(buffSalt, iterationCount);

    // Create a key from the secret value.
    CryptographicKey keyOriginal = objKdfProv.CreateKey(buffSecret);

    // Derive a key based on the original key and the derivation parameters.
    IBuffer keyDerived = CryptographicEngine.DeriveKeyMaterial(
        keyOriginal,
        pbkdf2Params,
        targetSize);

    // Encode the key to a hexadecimal value (for display)
    String strKeyHex = CryptographicBuffer.EncodeToHexString(keyDerived);

    // Return the encoded string
    return strKeyHex;
}

Encrypt(CryptographicKey, IBuffer, IBuffer) Encrypt(CryptographicKey, IBuffer, IBuffer) Encrypt(CryptographicKey, IBuffer, IBuffer)

Encrypts data by using a symmetric or asymmetric algorithm.

public static IBuffer Encrypt(CryptographicKey key, IBuffer data, IBuffer iv)public static IBuffer Encrypt(CryptographicKey key, IBuffer data, IBuffer iv)Public Static Function Encrypt(key As CryptographicKey, data As IBuffer, iv As IBuffer) As IBuffer
Parameters
key
CryptographicKey CryptographicKey CryptographicKey

Cryptographic key to use for encryption. This can be an asymmetric or a symmetric key. For more information, see AsymmetricKeyAlgorithmProvider and SymmetricKeyAlgorithmProvider.

data
IBuffer IBuffer IBuffer

Data to encrypt.

iv
IBuffer IBuffer IBuffer

Buffer that contains the initialization vector. This can be null for a symmetric algorithm and should always be null for an asymmetric algorithm. If an initialization vector (IV) was used to encrypt the data, you must use the same IV to decrypt the data. You can use the GenerateRandom method to create an IV that contains random data. Other IVs, such as nonce-generated vectors, require custom implementation. For more information, see Cryptographic keys.

Cipher block chaining (CBC) block cipher mode algorithms require an initialization vector. For more information, see Remarks.

Returns

Encrypted data.

Attributes

Remarks

Of the symmetric algorithms supported by Microsoft, the following require an initialization vector:

Examples

public void SampleCipherDecryption(
    String strAlgName,
    IBuffer buffEncrypt,
    IBuffer iv,
    BinaryStringEncoding encoding,
    CryptographicKey key)
{
    // Declare a buffer to contain the decrypted data.
    IBuffer buffDecrypted;

    // Open an symmetric algorithm provider for the specified algorithm. 
    SymmetricKeyAlgorithmProvider objAlg = SymmetricKeyAlgorithmProvider.OpenAlgorithm(strAlgName);

    // The input key must be securely shared between the sender of the encrypted message
    // and the recipient. The initialization vector must also be shared but does not
    // need to be shared in a secure manner. If the sender encodes a message string 
    // to a buffer, the binary encoding method must also be shared with the recipient.
    buffDecrypted = CryptographicEngine.Decrypt(key, buffEncrypt, iv);

    // Convert the decrypted buffer to a string (for display). If the sender created the
    // original message buffer from a string, the sender must tell the recipient what 
    // BinaryStringEncoding value was used. Here, BinaryStringEncoding.Utf8 is used to
    // convert the message to a buffer before encryption and to convert the decrypted
    // buffer back to the original plaintext.
    String strDecrypted = CryptographicBuffer.ConvertBinaryToString(encoding, buffDecrypted);
}

See Also

EncryptAndAuthenticate(CryptographicKey, IBuffer, IBuffer, IBuffer) EncryptAndAuthenticate(CryptographicKey, IBuffer, IBuffer, IBuffer) EncryptAndAuthenticate(CryptographicKey, IBuffer, IBuffer, IBuffer)

Performs authenticated encryption.

public static EncryptedAndAuthenticatedData EncryptAndAuthenticate(CryptographicKey key, IBuffer data, IBuffer nonce, IBuffer authenticatedData)public static EncryptedAndAuthenticatedData EncryptAndAuthenticate(CryptographicKey key, IBuffer data, IBuffer nonce, IBuffer authenticatedData)Public Static Function EncryptAndAuthenticate(key As CryptographicKey, data As IBuffer, nonce As IBuffer, authenticatedData As IBuffer) As EncryptedAndAuthenticatedData
Parameters
key
CryptographicKey CryptographicKey CryptographicKey

Symmetric key to use for encryption.

data
IBuffer IBuffer IBuffer

Data to be encrypted and authenticated.

nonce
IBuffer IBuffer IBuffer

Nonce to be used. A nonce is a variable that has minimal chance of repeating. For example, you can use a random value that is newly generated for each use, a time stamp, a sequence number, or some combination of these. The Microsoft GCM implementation requires a 12-byte nonce. The CCM implementation requires a 7- to 13- byte nonce.

authenticatedData
IBuffer IBuffer IBuffer

Authenticated data. This can be Null.

Returns

The encrypted and authenticated data.If the method fails, authentication fails; if the method succeeds, the authentication succeeded as well.

Attributes

Remarks

Authenticated encryption encrypts and authenticates content in one operation. An authenticator, also called a tag, is used during encryption and the output of the process contains a tag-ciphertext pair. For more information, see the AuthenticationTag and EncryptedData properties. The decryption process verifies the ciphertext against the tag.

You can use an authenticated encryption algorithm after calling the OpenAlgorithm method on the SymmetricKeyAlgorithmProvider class and specifying the name of the algorithm to open. The following algorithm names are supported for authenticated encryption and decryption:

Examples

public void AuthenticatedDecryption(
    String strAlgName,
    CryptographicKey key,
    EncryptedAndAuthenticatedData objEncrypted,
    BinaryStringEncoding encoding,
    IBuffer buffNonce)
{
    // Declare a buffer to contain the decrypted data.
    IBuffer buffDecrypted;

    // Open a SymmetricKeyAlgorithmProvider object for the specified algorithm.
    SymmetricKeyAlgorithmProvider objAlgProv = SymmetricKeyAlgorithmProvider.OpenAlgorithm(strAlgName);

    // The input key must be securely shared between the sender of the encrypted message
    // and the recipient. The nonce must also be shared but does not need to be shared
    // in a secure manner. If the sender encodes the message string to a buffer, the
    // binary encoding method must also be shared with the recipient.
    // The recipient uses the DecryptAndAuthenticate() method as follows to decrypt the 
    // message, authenticate it, and verify that it has not been altered in transit.
    buffDecrypted = CryptographicEngine.DecryptAndAuthenticate(
        key,
        objEncrypted.EncryptedData,
        buffNonce,
        objEncrypted.AuthenticationTag,
        null);

    // Convert the decrypted buffer to a string (for display). If the sender created the
    // original message buffer from a string, the sender must tell the recipient what 
    // BinaryStringEncoding value was used. Here, BinaryStringEncoding.Utf8 is used to
    // convert the message to a buffer before encryption and to convert the decrypted
    // buffer back to the original plaintext.
    String strDecrypted = CryptographicBuffer.ConvertBinaryToString(encoding, buffDecrypted);

}

Sign(CryptographicKey, IBuffer) Sign(CryptographicKey, IBuffer) Sign(CryptographicKey, IBuffer)

Signs digital content. For more information, see MACs, hashes, and signatures.

public static IBuffer Sign(CryptographicKey key, IBuffer data)public static IBuffer Sign(CryptographicKey key, IBuffer data)Public Static Function Sign(key As CryptographicKey, data As IBuffer) As IBuffer
Parameters
data
IBuffer IBuffer IBuffer

Data to be signed.

Returns

The data's signature.

Attributes

Remarks

If the key is a persisted key and the operation requires UI or takes a long time, use the SignAsync method instead.

For more information about signing digital data, see MACs, hashes, and signatures.

Examples

public IBuffer SampleCreateHMAC(
    String strMsg,
    String strAlgName,
    out IBuffer buffMsg,
    out CryptographicKey hmacKey)
{
    // Create a MacAlgorithmProvider object for the specified algorithm.
    MacAlgorithmProvider objMacProv = MacAlgorithmProvider.OpenAlgorithm(strAlgName);

    // Create a buffer that contains the message to be signed.
    BinaryStringEncoding encoding = BinaryStringEncoding.Utf8;
    buffMsg = CryptographicBuffer.ConvertStringToBinary(strMsg, encoding);

    // Create a key to be signed with the message.
    IBuffer buffKeyMaterial = CryptographicBuffer.GenerateRandom(objMacProv.MacLength);
    hmacKey = objMacProv.CreateKey(buffKeyMaterial);

    // Sign the key and message together.
    IBuffer buffHMAC = CryptographicEngine.Sign(hmacKey, buffMsg);

    // Verify that the HMAC length is correct for the selected algorithm
    if (buffHMAC.Length != objMacProv.MacLength)
    {
        throw new Exception("Error computing digest");
    }

    // Return the HMAC.
    return buffHMAC;
}

SignAsync(CryptographicKey, IBuffer) SignAsync(CryptographicKey, IBuffer) SignAsync(CryptographicKey, IBuffer)

Computes a hash for the supplied input data, and then signs the computed hash using the specified key.

public static IAsyncOperation<IBuffer> SignAsync(CryptographicKey key, IBuffer data)public static IAsyncOperation<IBuffer> SignAsync(CryptographicKey key, IBuffer data)Public Static Function SignAsync(key As CryptographicKey, data As IBuffer) As IAsyncOperation( Of IBuffer )
Parameters
key
CryptographicKey CryptographicKey CryptographicKey

The key to use to compute and sign the hash.

data
IBuffer IBuffer IBuffer

The raw input data to sign. The data is not hashed.

Returns

An asynchronous operation to retrieve the hashed and signed data.

Attributes

Remarks

The input data supplied to the SignAsync method is raw data that has not been hashed. To sign hashed data, use the SignHashedDataAsync method.

If the key is a persisted key and the operation requires UI or takes a long time, use the SignAsync method instead of the Sign method.

SignHashedData(CryptographicKey, IBuffer) SignHashedData(CryptographicKey, IBuffer) SignHashedData(CryptographicKey, IBuffer)

Signs the hashed input data using the specified key.

public static IBuffer SignHashedData(CryptographicKey key, IBuffer data)public static IBuffer SignHashedData(CryptographicKey key, IBuffer data)Public Static Function SignHashedData(key As CryptographicKey, data As IBuffer) As IBuffer
Parameters
key
CryptographicKey CryptographicKey CryptographicKey

The key to use to sign the hash. This key must be an asymmetric key obtained from a PersistedKeyProvider or AsymmetricKeyAlgorithmProvider.

data
IBuffer IBuffer IBuffer

The input data to sign. The data is a hashed value which can be obtained through incremental hash.

Returns

The signed data.

Attributes

Remarks

The input data supplied to the SignHashedData method is a hashed value. To sign raw data that has not been hashed, use the SignAsync method.

If the key is a persisted key and the operation requires UI or takes a long time, use the SignHashedDataAsync method instead.

SignHashedDataAsync(CryptographicKey, IBuffer) SignHashedDataAsync(CryptographicKey, IBuffer) SignHashedDataAsync(CryptographicKey, IBuffer)

Signs the hashed input data using the specified key.

public static IAsyncOperation<IBuffer> SignHashedDataAsync(CryptographicKey key, IBuffer data)public static IAsyncOperation<IBuffer> SignHashedDataAsync(CryptographicKey key, IBuffer data)Public Static Function SignHashedDataAsync(key As CryptographicKey, data As IBuffer) As IAsyncOperation( Of IBuffer )
Parameters
key
CryptographicKey CryptographicKey CryptographicKey

The key to use to sign the hash. This key must be an asymmetric key obtained from a PersistedKeyProvider or AsymmetricKeyAlgorithmProvider.

data
IBuffer IBuffer IBuffer

The input data to sign. The data is a hashed value which can be obtained through incremental hash.

Returns

An asynchronous operation to retrieve the signed data.

Attributes

Remarks

The input data supplied to the SignHashedDataAsync method is a hashed value. To sign raw data that has not been hashed, use the SignAsync method.

If the key is a persisted key and the operation requires UI or takes a long time, use the SignHashedDataAsync method instead of the SignHashedData method.

VerifySignature(CryptographicKey, IBuffer, IBuffer) VerifySignature(CryptographicKey, IBuffer, IBuffer) VerifySignature(CryptographicKey, IBuffer, IBuffer)

Verifies a message signature.

public static PlatForm::Boolean VerifySignature(CryptographicKey key, IBuffer data, IBuffer signature)public static bool VerifySignature(CryptographicKey key, IBuffer data, IBuffer signature)Public Static Function VerifySignature(key As CryptographicKey, data As IBuffer, signature As IBuffer) As bool
Parameters
key
CryptographicKey CryptographicKey CryptographicKey

Key used for verification. This must be the same key previously used to sign the message.

data
IBuffer IBuffer IBuffer

Message to be verified.

signature
IBuffer IBuffer IBuffer

Signature previously computed over the message to be verified.

Returns
bool bool bool

true if the message is verified.

Attributes

Remarks

To sign content, the sender typically creates a hash over the message, signs (encrypts) the hash, and then sends both the signature and the unencrypted message. The recipient uses the same key and algorithm to calculate a hash over the message, decrypts the signature, and compares the decrypted signature to the hash value. If they match, the recipient can be fairly certain that the message did, in fact, come from the sender and was not altered during transmission. For more information, see MACs, hashes, and signatures.

Examples

public void SampleVerifyHMAC(
    IBuffer buffMsg,
    CryptographicKey hmacKey,
    IBuffer buffHMAC)
{
    // The input key must be securely shared between the sender of the HMAC and 
    // the recipient. The recipient uses the CryptographicEngine.VerifySignature() 
    // method as follows to verify that the message has not been altered in transit.
    Boolean IsAuthenticated = CryptographicEngine.VerifySignature(hmacKey, buffMsg, buffHMAC);
    if (!IsAuthenticated)
    {
        throw new Exception("The message cannot be verified.");
    }
}

VerifySignatureWithHashInput(CryptographicKey, IBuffer, IBuffer) VerifySignatureWithHashInput(CryptographicKey, IBuffer, IBuffer) VerifySignatureWithHashInput(CryptographicKey, IBuffer, IBuffer)

Verifies the signature of the specified input data against a known signature.

public static PlatForm::Boolean VerifySignatureWithHashInput(CryptographicKey key, IBuffer data, IBuffer signature)public static bool VerifySignatureWithHashInput(CryptographicKey key, IBuffer data, IBuffer signature)Public Static Function VerifySignatureWithHashInput(key As CryptographicKey, data As IBuffer, signature As IBuffer) As bool
Parameters
key
CryptographicKey CryptographicKey CryptographicKey

The key to use to retrieve the signature from the input data. This key must be an asymmetric key obtained from a PersistedKeyProvider or AsymmetricKeyAlgorithmProvider.

data
IBuffer IBuffer IBuffer

The data to be verified. The data is a hashed value of raw data.

signature
IBuffer IBuffer IBuffer

The known signature to use to verify the signature of the input data.

Returns
bool bool bool

True if the signature is verified; otherwise false.

Attributes