System.Security.Cryptography.RSAImplementation.RSAOpenSsl.ExportParameters C# (CSharp) Метод

ExportParameters() публичный Метод

public ExportParameters ( bool includePrivateParameters ) : RSAParameters
includePrivateParameters bool
Результат RSAParameters
        public override RSAParameters ExportParameters(bool includePrivateParameters)
        {
            // It's entirely possible that this line will cause the key to be generated in the first place.
            SafeRsaHandle key = _key.Value;

            CheckInvalidKey(key);

            RSAParameters rsaParameters = Interop.Crypto.ExportRsaParameters(key, includePrivateParameters);
            bool hasPrivateKey = rsaParameters.D != null;

            if (hasPrivateKey != includePrivateParameters || !HasConsistentPrivateKey(ref rsaParameters))
            {
                throw new CryptographicException(SR.Cryptography_CSP_NoPrivateKey);
            }

            return rsaParameters;
        }