Opc.Ua.RsaUtils.GetCipherTextBlockSize C# (CSharp) 메소드

GetCipherTextBlockSize() 공개 정적인 메소드

Return the ciphertext block size for RSA OAEP encryption.
public static GetCipherTextBlockSize ( X509Certificate2 encryptingCertificate, bool useOaep ) : int
encryptingCertificate System.Security.Cryptography.X509Certificates.X509Certificate2
useOaep bool
리턴 int
        public static int GetCipherTextBlockSize(X509Certificate2 encryptingCertificate, bool useOaep)
        {
            using (RSA rsa = encryptingCertificate.GetRSAPublicKey())
            {
                if (rsa != null)
                {
                    return rsa.KeySize / 8;
                }
            }
            return -1;
        }