Exemple #1
0
        /// <summary>
        /// Base constructor.
        /// </summary>
        /// <param name="algorithm">The name of the signature algorithm to use.</param>
        /// <param name="publicKey">The public key to be used in the verification operation.</param>
        public Asn1VerifierFactory(String algorithm, AsymmetricKeyParameter publicKey)
        {
            DerObjectIdentifier sigOid = X509Utilities.GetAlgorithmOid(algorithm);

            this.publicKey = publicKey;
            this.algID     = X509Utilities.GetSigAlgID(sigOid, algorithm);
        }
Exemple #2
0
        /// <summary>
        /// Constructor which also specifies a source of randomness to be used if one is required.
        /// </summary>
        /// <param name="algorithm">The name of the signature algorithm to use.</param>
        /// <param name="privateKey">The private key to be used in the signing operation.</param>
        /// <param name="random">The source of randomness to be used in signature calculation.</param>
        public Asn1SignatureFactory(string algorithm, AsymmetricKeyParameter privateKey, SecureRandom random)
        {
            DerObjectIdentifier sigOid = X509Utilities.GetAlgorithmOid(algorithm);

            this.algorithm  = algorithm;
            this.privateKey = privateKey;
            this.random     = random;
            this.algID      = X509Utilities.GetSigAlgID(sigOid, algorithm);
        }