Sign() public static méthode

Signs the data using the SecurityPolicyUri and returns the signature.
public static Sign ( X509Certificate2 certificate, string securityPolicyUri, byte dataToSign ) : SignatureData
certificate X509Certificate2
securityPolicyUri string
dataToSign byte
Résultat SignatureData
Exemple #1
0
        /// <summary>
        /// Creates a signature with the token.
        /// </summary>
        public override SignatureData Sign(byte[] dataToSign, string securityPolicyUri)
        {
            X509Certificate2 certificate = m_certificate;

            if (certificate == null)
            {
                certificate = CertificateFactory.Create(m_certificateData, true);
            }

            SignatureData signatureData = SecurityPolicies.Sign(
                certificate,
                securityPolicyUri,
                dataToSign);

            m_certificateData = certificate.GetRawCertData();

            return(signatureData);
        }
Exemple #2
0
        /// <summary>
        /// Creates a signature with the token.
        /// </summary>
        public override SignatureData Sign(byte[] dataToSign, string securityPolicyUri)
        {
            X509Certificate2 certificate = m_certificate;

            if (certificate == null)
            {
                certificate = new X509Certificate2(m_certificateData);
            }

            SignatureData signatureData = SecurityPolicies.Sign(
                certificate,
                securityPolicyUri,
                dataToSign);

            m_certificateData = certificate.RawData;

            return(signatureData);
        }