Opc.Ua.RsaUtils.RsaPkcs15_GetSignatureLength C# (CSharp) Method

RsaPkcs15_GetSignatureLength() public static method

Returns the length of a RSA PKCS#1 v1.5 signature of a digest.
public static RsaPkcs15_GetSignatureLength ( X509Certificate2 signingCertificate ) : int
signingCertificate System.Security.Cryptography.X509Certificates.X509Certificate2
return int
        public static int RsaPkcs15_GetSignatureLength(X509Certificate2 signingCertificate)
        {
            using (RSA rsa = signingCertificate.GetRSAPublicKey())
            {
                if (rsa == null)
                {
                    throw ServiceResultException.Create(StatusCodes.BadSecurityChecksFailed, "No public key for certificate.");
                }

                return rsa.KeySize / 8;
            }
        }