vb System.Security.Cryptography.AsymmetricKeyExchangeDeformatter.DecryptKeyExchange类(方法)实例源码

下面列出了vb System.Security.Cryptography.AsymmetricKeyExchangeDeformatter.DecryptKeyExchange 类(方法)源码代码实例,从而了解它的用法。

作者:VB.NET开发    项目:System.Security.Cryptograph   
' Create the encrypted key exchange data from the specified input
' data. This method uses the RSACryptoServiceProvider only. To
' support additional providers or provide custom decryption logic,
' add logic to this member.
Public Overrides Function DecryptKeyExchange(
    ByVal rgbData() As Byte) As Byte()

    Dim decryptedBytes() As Byte

    If (Not rsaKey Is Nothing) Then
        If (TypeOf (rsaKey) Is RSACryptoServiceProvider) Then
            Dim rsaProvider As RSACryptoServiceProvider
            rsaProvider = CType(rsaKey, RSACryptoServiceProvider)

            decryptedBytes = rsaProvider.Decrypt(rgbData, True)
        End If

        ' Add custom decryption logic here.

    Else
        Throw New CryptographicUnexpectedOperationException(
            "Cryptography_MissingKey")
    End If

    Return decryptedBytes
End Function


问题


面经


文章

微信
公众号

扫码关注公众号