diff options
author | David Hook <dgh@bouncycastle.org> | 2015-10-24 16:31:54 +1100 |
---|---|---|
committer | David Hook <dgh@bouncycastle.org> | 2015-10-24 16:31:54 +1100 |
commit | 0178c1bb391ac346c6a75b4ad7a6bed73843c704 (patch) | |
tree | 2dee4de4e4f20cca632d3950fee17c59edf66db2 | |
parent | comment update (diff) | |
download | BouncyCastle.NET-ed25519-0178c1bb391ac346c6a75b4ad7a6bed73843c704.tar.xz |
Final naming refactor
-rw-r--r-- | crypto/src/cms/CMSSignedDataGenerator.cs | 6 | ||||
-rw-r--r-- | crypto/src/cms/SignerInfoGenerator.cs | 14 | ||||
-rw-r--r-- | crypto/src/crypto/ISignatureCalculatorFactory.cs | 2 | ||||
-rw-r--r-- | crypto/src/crypto/IVerifierFactory.cs (renamed from crypto/src/crypto/ISignatureVerifier.cs) | 2 | ||||
-rw-r--r-- | crypto/src/crypto/IVerifierFactoryProvider.cs (renamed from crypto/src/crypto/ISignatureVerifierProvider.cs) | 4 | ||||
-rw-r--r-- | crypto/src/crypto/operators/Asn1Signature.cs | 18 | ||||
-rw-r--r-- | crypto/src/ocsp/BasicOCSPRespGenerator.cs | 6 | ||||
-rw-r--r-- | crypto/src/pkcs/Pkcs10CertificationRequest.cs | 12 | ||||
-rw-r--r-- | crypto/src/x509/X509Certificate.cs | 6 | ||||
-rw-r--r-- | crypto/src/x509/X509Crl.cs | 4 | ||||
-rw-r--r-- | crypto/src/x509/X509V1CertificateGenerator.cs | 10 | ||||
-rw-r--r-- | crypto/src/x509/X509V2AttributeCertificate.cs | 6 | ||||
-rw-r--r-- | crypto/src/x509/X509V2AttributeCertificateGenerator.cs | 10 | ||||
-rw-r--r-- | crypto/src/x509/X509V2CRLGenerator.cs | 10 | ||||
-rw-r--r-- | crypto/src/x509/X509V3CertificateGenerator.cs | 10 | ||||
-rw-r--r-- | crypto/test/src/cms/test/SignedDataTest.cs | 4 |
16 files changed, 62 insertions, 62 deletions
diff --git a/crypto/src/cms/CMSSignedDataGenerator.cs b/crypto/src/cms/CMSSignedDataGenerator.cs index 60d723d60..a80cde509 100644 --- a/crypto/src/cms/CMSSignedDataGenerator.cs +++ b/crypto/src/cms/CMSSignedDataGenerator.cs @@ -43,7 +43,7 @@ namespace Org.BouncyCastle.Cms { private readonly CmsSignedGenerator outer; - private readonly ISignatureCalculatorFactory sigCalc; + private readonly ISignatureFactory sigCalc; private readonly SignerIdentifier signerIdentifier; private readonly string digestOID; private readonly string encOID; @@ -66,7 +66,7 @@ namespace Org.BouncyCastle.Cms string signatureName = digestName + "with" + Helper.GetEncryptionAlgName(encOID); this.outer = outer; - this.sigCalc = new Asn1SignatureCalculatorFactory(signatureName, key); + this.sigCalc = new Asn1SignatureFactory(signatureName, key); this.signerIdentifier = signerIdentifier; this.digestOID = digestOID; this.encOID = encOID; @@ -77,7 +77,7 @@ namespace Org.BouncyCastle.Cms internal SignerInf( CmsSignedGenerator outer, - ISignatureCalculatorFactory sigCalc, + ISignatureFactory sigCalc, SignerIdentifier signerIdentifier, CmsAttributeTableGenerator sAttr, CmsAttributeTableGenerator unsAttr, diff --git a/crypto/src/cms/SignerInfoGenerator.cs b/crypto/src/cms/SignerInfoGenerator.cs index 67600dea4..7b9318cc9 100644 --- a/crypto/src/cms/SignerInfoGenerator.cs +++ b/crypto/src/cms/SignerInfoGenerator.cs @@ -17,18 +17,18 @@ namespace Org.BouncyCastle.Cms public class SignerInfoGenerator { internal X509Certificate certificate; - internal ISignatureCalculatorFactory contentSigner; + internal ISignatureFactory contentSigner; internal SignerIdentifier sigId; internal CmsAttributeTableGenerator signedGen; internal CmsAttributeTableGenerator unsignedGen; private bool isDirectSignature; - internal SignerInfoGenerator(SignerIdentifier sigId, ISignatureCalculatorFactory signerFactory): this(sigId, signerFactory, false) + internal SignerInfoGenerator(SignerIdentifier sigId, ISignatureFactory signerFactory): this(sigId, signerFactory, false) { } - internal SignerInfoGenerator(SignerIdentifier sigId, ISignatureCalculatorFactory signerFactory, bool isDirectSignature) + internal SignerInfoGenerator(SignerIdentifier sigId, ISignatureFactory signerFactory, bool isDirectSignature) { this.sigId = sigId; this.contentSigner = signerFactory; @@ -45,7 +45,7 @@ namespace Org.BouncyCastle.Cms } } - internal SignerInfoGenerator(SignerIdentifier sigId, ISignatureCalculatorFactory contentSigner, CmsAttributeTableGenerator signedGen, CmsAttributeTableGenerator unsignedGen) + internal SignerInfoGenerator(SignerIdentifier sigId, ISignatureFactory contentSigner, CmsAttributeTableGenerator signedGen, CmsAttributeTableGenerator unsignedGen) { this.sigId = sigId; this.contentSigner = contentSigner; @@ -117,7 +117,7 @@ namespace Org.BouncyCastle.Cms * @return a SignerInfoGenerator * @throws OperatorCreationException if the generator cannot be built. */ - public SignerInfoGenerator Build(ISignatureCalculatorFactory contentSigner, X509Certificate certificate) + public SignerInfoGenerator Build(ISignatureFactory contentSigner, X509Certificate certificate) { SignerIdentifier sigId = new SignerIdentifier(new IssuerAndSerialNumber(certificate.IssuerDN, new DerInteger(certificate.SerialNumber))); @@ -136,14 +136,14 @@ namespace Org.BouncyCastle.Cms * @param subjectKeyIdentifier key identifier to identify the public key for verifying the signature. * @return a SignerInfoGenerator */ - public SignerInfoGenerator Build(ISignatureCalculatorFactory signerFactory, byte[] subjectKeyIdentifier) + public SignerInfoGenerator Build(ISignatureFactory signerFactory, byte[] subjectKeyIdentifier) { SignerIdentifier sigId = new SignerIdentifier(new DerOctetString(subjectKeyIdentifier)); return CreateGenerator(signerFactory, sigId); } - private SignerInfoGenerator CreateGenerator(ISignatureCalculatorFactory contentSigner, SignerIdentifier sigId) + private SignerInfoGenerator CreateGenerator(ISignatureFactory contentSigner, SignerIdentifier sigId) { if (directSignature) { diff --git a/crypto/src/crypto/ISignatureCalculatorFactory.cs b/crypto/src/crypto/ISignatureCalculatorFactory.cs index b60adb168..cbca7d1a7 100644 --- a/crypto/src/crypto/ISignatureCalculatorFactory.cs +++ b/crypto/src/crypto/ISignatureCalculatorFactory.cs @@ -5,7 +5,7 @@ namespace Org.BouncyCastle.Crypto /// <summary> /// Base interface for operators that serve as stream-based signature calculators. /// </summary> - public interface ISignatureCalculatorFactory + public interface ISignatureFactory { /// <summary>The algorithm details object for this calculator.</summary> Object AlgorithmDetails { get ; } diff --git a/crypto/src/crypto/ISignatureVerifier.cs b/crypto/src/crypto/IVerifierFactory.cs index 1f42a0256..9502b14a7 100644 --- a/crypto/src/crypto/ISignatureVerifier.cs +++ b/crypto/src/crypto/IVerifierFactory.cs @@ -5,7 +5,7 @@ namespace Org.BouncyCastle.Crypto /// <summary> /// Base interface for operators that serve as stream-based signature verifiers. /// </summary> - public interface ISignatureVerifier + public interface IVerifierFactory { /// <summary>The algorithm details object for this verifier.</summary> Object AlgorithmDetails { get ; } diff --git a/crypto/src/crypto/ISignatureVerifierProvider.cs b/crypto/src/crypto/IVerifierFactoryProvider.cs index 20180e22a..5dc2f9ea4 100644 --- a/crypto/src/crypto/ISignatureVerifierProvider.cs +++ b/crypto/src/crypto/IVerifierFactoryProvider.cs @@ -5,14 +5,14 @@ namespace Org.BouncyCastle.Crypto /// <summary> /// Base interface for a provider to support the dynamic creation of signature verifiers. /// </summary> - public interface ISignatureVerifierProvider + public interface IVerifierFactoryProvider { /// <summary> /// Return a signature verfier for signature algorithm described in the passed in algorithm details object. /// </summary> /// <param name="algorithmDetails">The details of the signature algorithm verification is required for.</param> /// <returns>A new signature verifier.</returns> - ISignatureVerifier CreateSignatureVerifier (Object algorithmDetails); + IVerifierFactory CreateSignatureVerifier (Object algorithmDetails); } } diff --git a/crypto/src/crypto/operators/Asn1Signature.cs b/crypto/src/crypto/operators/Asn1Signature.cs index 0943b43f7..4f1e16761 100644 --- a/crypto/src/crypto/operators/Asn1Signature.cs +++ b/crypto/src/crypto/operators/Asn1Signature.cs @@ -329,7 +329,7 @@ namespace Org.BouncyCastle.Crypto.Operators /// Calculator factory class for signature generation in ASN.1 based profiles that use an AlgorithmIdentifier to preserve /// signature algorithm details. /// </summary> - public class Asn1SignatureCalculatorFactory: ISignatureCalculatorFactory + public class Asn1SignatureFactory: ISignatureFactory { private readonly AlgorithmIdentifier algID; private readonly string algorithm; @@ -341,7 +341,7 @@ namespace Org.BouncyCastle.Crypto.Operators /// </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> - public Asn1SignatureCalculatorFactory (string algorithm, AsymmetricKeyParameter privateKey): this(algorithm, privateKey, null) + public Asn1SignatureFactory (string algorithm, AsymmetricKeyParameter privateKey): this(algorithm, privateKey, null) { } @@ -351,7 +351,7 @@ namespace Org.BouncyCastle.Crypto.Operators /// <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 Asn1SignatureCalculatorFactory (string algorithm, AsymmetricKeyParameter privateKey, SecureRandom random) + public Asn1SignatureFactory (string algorithm, AsymmetricKeyParameter privateKey, SecureRandom random) { DerObjectIdentifier sigOid = X509Utilities.GetAlgorithmOid (algorithm); @@ -441,7 +441,7 @@ namespace Org.BouncyCastle.Crypto.Operators /// Verifier class for signature verification in ASN.1 based profiles that use an AlgorithmIdentifier to preserve /// signature algorithm details. /// </summary> - public class Asn1SignatureVerifier: ISignatureVerifier + public class Asn1VerifierFactory: IVerifierFactory { private readonly AlgorithmIdentifier algID; private readonly AsymmetricKeyParameter publicKey; @@ -451,7 +451,7 @@ namespace Org.BouncyCastle.Crypto.Operators /// </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 Asn1SignatureVerifier (String algorithm, AsymmetricKeyParameter publicKey) + public Asn1VerifierFactory (String algorithm, AsymmetricKeyParameter publicKey) { DerObjectIdentifier sigOid = X509Utilities.GetAlgorithmOid (algorithm); @@ -459,7 +459,7 @@ namespace Org.BouncyCastle.Crypto.Operators this.algID = X509Utilities.GetSigAlgID (sigOid, algorithm); } - public Asn1SignatureVerifier (AlgorithmIdentifier algorithm, AsymmetricKeyParameter publicKey) + public Asn1VerifierFactory (AlgorithmIdentifier algorithm, AsymmetricKeyParameter publicKey) { this.publicKey = publicKey; this.algID = algorithm; @@ -529,7 +529,7 @@ namespace Org.BouncyCastle.Crypto.Operators /// <summary> /// Provider class which supports dynamic creation of signature verifiers. /// </summary> - public class Asn1SignatureVerifierProvider: ISignatureVerifierProvider + public class Asn1SignatureVerifierProvider: IVerifierFactoryProvider { private readonly AsymmetricKeyParameter publicKey; @@ -542,9 +542,9 @@ namespace Org.BouncyCastle.Crypto.Operators this.publicKey = publicKey; } - public ISignatureVerifier CreateSignatureVerifier(Object algorithmDetails) + public IVerifierFactory CreateSignatureVerifier(Object algorithmDetails) { - return new Asn1SignatureVerifier ((AlgorithmIdentifier)algorithmDetails, publicKey); + return new Asn1VerifierFactory ((AlgorithmIdentifier)algorithmDetails, publicKey); } /// <summary> diff --git a/crypto/src/ocsp/BasicOCSPRespGenerator.cs b/crypto/src/ocsp/BasicOCSPRespGenerator.cs index 508d94ec5..7705071fd 100644 --- a/crypto/src/ocsp/BasicOCSPRespGenerator.cs +++ b/crypto/src/ocsp/BasicOCSPRespGenerator.cs @@ -185,7 +185,7 @@ namespace Org.BouncyCastle.Ocsp } private BasicOcspResp GenerateResponse( - ISignatureCalculatorFactory signatureCalculator, + ISignatureFactory signatureCalculator, X509Certificate[] chain, DateTime producedAt) { @@ -277,7 +277,7 @@ namespace Org.BouncyCastle.Ocsp throw new ArgumentException("no signing algorithm specified"); } - return GenerateResponse(new Asn1SignatureCalculatorFactory(signingAlgorithm, privateKey, random), chain, producedAt); + return GenerateResponse(new Asn1SignatureFactory(signingAlgorithm, privateKey, random), chain, producedAt); } /// <summary> @@ -288,7 +288,7 @@ namespace Org.BouncyCastle.Ocsp /// <param name="producedAt">"produced at" date.</param> /// <returns></returns> public BasicOcspResp Generate( - ISignatureCalculatorFactory signatureCalculatorFactory, + ISignatureFactory signatureCalculatorFactory, X509Certificate[] chain, DateTime producedAt) { diff --git a/crypto/src/pkcs/Pkcs10CertificationRequest.cs b/crypto/src/pkcs/Pkcs10CertificationRequest.cs index 692ab2bd3..c581f8b34 100644 --- a/crypto/src/pkcs/Pkcs10CertificationRequest.cs +++ b/crypto/src/pkcs/Pkcs10CertificationRequest.cs @@ -209,7 +209,7 @@ namespace Org.BouncyCastle.Pkcs /// <param name="publicKey">Public Key to be included in cert reqest.</param> /// <param name="attributes">ASN1Set of Attributes.</param> /// <param name="signingKey">Matching Private key for nominated (above) public key to be used to sign the request.</param> - [Obsolete("Use constructor with an ISignatureCalculatorFactory")] + [Obsolete("Use constructor with an ISignatureFactory")] public Pkcs10CertificationRequest( string signatureAlgorithm, X509Name subject, @@ -228,7 +228,7 @@ namespace Org.BouncyCastle.Pkcs if (!signingKey.IsPrivate) throw new ArgumentException("key for signing must be private", "signingKey"); - init(new Asn1SignatureCalculatorFactory(signatureAlgorithm, signingKey), subject, publicKey, attributes, signingKey); + init(new Asn1SignatureFactory(signatureAlgorithm, signingKey), subject, publicKey, attributes, signingKey); } /// <summary> @@ -240,7 +240,7 @@ namespace Org.BouncyCastle.Pkcs /// <param name="attributes">ASN1Set of Attributes.</param> /// <param name="signingKey">Matching Private key for nominated (above) public key to be used to sign the request.</param> public Pkcs10CertificationRequest( - ISignatureCalculatorFactory signatureCalculatorFactory, + ISignatureFactory signatureCalculatorFactory, X509Name subject, AsymmetricKeyParameter publicKey, Asn1Set attributes, @@ -261,7 +261,7 @@ namespace Org.BouncyCastle.Pkcs } private void init( - ISignatureCalculatorFactory signatureCalculator, + ISignatureFactory signatureCalculator, X509Name subject, AsymmetricKeyParameter publicKey, Asn1Set attributes, @@ -326,13 +326,13 @@ namespace Org.BouncyCastle.Pkcs } public bool Verify( - ISignatureVerifierProvider verifierProvider) + IVerifierFactoryProvider verifierProvider) { return Verify(verifierProvider.CreateSignatureVerifier(sigAlgId)); } public bool Verify( - ISignatureVerifier verifier) + IVerifierFactory verifier) { try { diff --git a/crypto/src/x509/X509Certificate.cs b/crypto/src/x509/X509Certificate.cs index c323fc8f1..a0c102e98 100644 --- a/crypto/src/x509/X509Certificate.cs +++ b/crypto/src/x509/X509Certificate.cs @@ -547,7 +547,7 @@ namespace Org.BouncyCastle.X509 public virtual void Verify( AsymmetricKeyParameter key) { - CheckSignature(new Asn1SignatureVerifier(c.SignatureAlgorithm, key)); + CheckSignature(new Asn1VerifierFactory(c.SignatureAlgorithm, key)); } /// <summary> @@ -557,13 +557,13 @@ namespace Org.BouncyCastle.X509 /// <returns>True if the signature is valid.</returns> /// <exception cref="Exception">If verifier provider is not appropriate or the certificate algorithm is invalid.</exception> public virtual void Verify( - ISignatureVerifierProvider verifierProvider) + IVerifierFactoryProvider verifierProvider) { CheckSignature(verifierProvider.CreateSignatureVerifier (c.SignatureAlgorithm)); } protected virtual void CheckSignature( - ISignatureVerifier verifier) + IVerifierFactory verifier) { if (!IsAlgIDEqual(c.SignatureAlgorithm, c.TbsCertificate.Signature)) throw new CertificateException("signature algorithm in TBS cert not same as outer cert"); diff --git a/crypto/src/x509/X509Crl.cs b/crypto/src/x509/X509Crl.cs index 0679cb240..0492720a2 100644 --- a/crypto/src/x509/X509Crl.cs +++ b/crypto/src/x509/X509Crl.cs @@ -94,13 +94,13 @@ namespace Org.BouncyCastle.X509 /// <returns>True if the signature is valid.</returns> /// <exception cref="Exception">If verifier provider is not appropriate or the CRL algorithm is invalid.</exception> public virtual void Verify( - ISignatureVerifierProvider verifierProvider) + IVerifierFactoryProvider verifierProvider) { CheckSignature(verifierProvider.CreateSignatureVerifier(c.SignatureAlgorithm)); } protected virtual void CheckSignature( - ISignatureVerifier verifier) + IVerifierFactory verifier) { if (!c.SignatureAlgorithm.Equals(c.TbsCertList.Signature)) { diff --git a/crypto/src/x509/X509V1CertificateGenerator.cs b/crypto/src/x509/X509V1CertificateGenerator.cs index a311d823a..79e3862e4 100644 --- a/crypto/src/x509/X509V1CertificateGenerator.cs +++ b/crypto/src/x509/X509V1CertificateGenerator.cs @@ -121,7 +121,7 @@ namespace Org.BouncyCastle.X509 /// This can be either a name or an OID, names are treated as case insensitive. /// </summary> /// <param name="signatureAlgorithm">string representation of the algorithm name</param> - [Obsolete("Not needed if Generate used with an ISignatureCalculatorFactory")] + [Obsolete("Not needed if Generate used with an ISignatureFactory")] public void SetSignatureAlgorithm( string signatureAlgorithm) { @@ -146,7 +146,7 @@ namespace Org.BouncyCastle.X509 /// </summary> /// <param name="privateKey">The private key of the issuer used to sign this certificate.</param> /// <returns>An X509Certificate.</returns> - [Obsolete("Use Generate with an ISignatureCalculatorFactory")] + [Obsolete("Use Generate with an ISignatureFactory")] public X509Certificate Generate( AsymmetricKeyParameter privateKey) { @@ -159,12 +159,12 @@ namespace Org.BouncyCastle.X509 /// <param name="privateKey">The private key of the issuer used to sign this certificate.</param> /// <param name="random">The Secure Random you want to use.</param> /// <returns>An X509Certificate.</returns> - [Obsolete("Use Generate with an ISignatureCalculatorFactory")] + [Obsolete("Use Generate with an ISignatureFactory")] public X509Certificate Generate( AsymmetricKeyParameter privateKey, SecureRandom random) { - return Generate(new Asn1SignatureCalculatorFactory(signatureAlgorithm, privateKey, random)); + return Generate(new Asn1SignatureFactory(signatureAlgorithm, privateKey, random)); } /// <summary> @@ -172,7 +172,7 @@ namespace Org.BouncyCastle.X509 /// </summary> /// <param name="signatureCalculatorFactory">A signature calculator factory with the necessary algorithm details.</param> /// <returns>An X509Certificate.</returns> - public X509Certificate Generate(ISignatureCalculatorFactory signatureCalculatorFactory) + public X509Certificate Generate(ISignatureFactory signatureCalculatorFactory) { tbsGen.SetSignature ((AlgorithmIdentifier)signatureCalculatorFactory.AlgorithmDetails); diff --git a/crypto/src/x509/X509V2AttributeCertificate.cs b/crypto/src/x509/X509V2AttributeCertificate.cs index cc72c23bb..ad9c467c6 100644 --- a/crypto/src/x509/X509V2AttributeCertificate.cs +++ b/crypto/src/x509/X509V2AttributeCertificate.cs @@ -155,7 +155,7 @@ namespace Org.BouncyCastle.X509 public virtual void Verify( AsymmetricKeyParameter key) { - CheckSignature(new Asn1SignatureVerifier(cert.SignatureAlgorithm, key)); + CheckSignature(new Asn1VerifierFactory(cert.SignatureAlgorithm, key)); } /// <summary> @@ -165,13 +165,13 @@ namespace Org.BouncyCastle.X509 /// <returns>True if the signature is valid.</returns> /// <exception cref="Exception">If verifier provider is not appropriate or the certificate algorithm is invalid.</exception> public virtual void Verify( - ISignatureVerifierProvider verifierProvider) + IVerifierFactoryProvider verifierProvider) { CheckSignature(verifierProvider.CreateSignatureVerifier(cert.SignatureAlgorithm)); } protected virtual void CheckSignature( - ISignatureVerifier verifier) + IVerifierFactory verifier) { if (!cert.SignatureAlgorithm.Equals(cert.ACInfo.Signature)) { diff --git a/crypto/src/x509/X509V2AttributeCertificateGenerator.cs b/crypto/src/x509/X509V2AttributeCertificateGenerator.cs index 195030554..8fd5dfdb9 100644 --- a/crypto/src/x509/X509V2AttributeCertificateGenerator.cs +++ b/crypto/src/x509/X509V2AttributeCertificateGenerator.cs @@ -73,7 +73,7 @@ namespace Org.BouncyCastle.X509 /// are treated as case insensitive. /// </summary> /// <param name="signatureAlgorithm">The algorithm name.</param> - [Obsolete("Not needed if Generate used with an ISignatureCalculatorFactory")] + [Obsolete("Not needed if Generate used with an ISignatureFactory")] public void SetSignatureAlgorithm( string signatureAlgorithm) { @@ -133,7 +133,7 @@ namespace Org.BouncyCastle.X509 /// <summary> /// Generate an X509 certificate, based on the current issuer and subject. /// </summary> - [Obsolete("Use Generate with an ISignatureCalculatorFactory")] + [Obsolete("Use Generate with an ISignatureFactory")] public IX509AttributeCertificate Generate( AsymmetricKeyParameter privateKey) { @@ -144,12 +144,12 @@ namespace Org.BouncyCastle.X509 /// Generate an X509 certificate, based on the current issuer and subject, /// using the supplied source of randomness, if required. /// </summary> - [Obsolete("Use Generate with an ISignatureCalculatorFactory")] + [Obsolete("Use Generate with an ISignatureFactory")] public IX509AttributeCertificate Generate( AsymmetricKeyParameter privateKey, SecureRandom random) { - return Generate(new Asn1SignatureCalculatorFactory(signatureAlgorithm, privateKey, random)); + return Generate(new Asn1SignatureFactory(signatureAlgorithm, privateKey, random)); } /// <summary> @@ -157,7 +157,7 @@ namespace Org.BouncyCastle.X509 /// </summary> /// <param name="signatureCalculatorFactory">A signature calculator factory with the necessary algorithm details.</param> /// <returns>An IX509AttributeCertificate.</returns> - public IX509AttributeCertificate Generate(ISignatureCalculatorFactory signatureCalculatorFactory) + public IX509AttributeCertificate Generate(ISignatureFactory signatureCalculatorFactory) { if (!extGenerator.IsEmpty) { diff --git a/crypto/src/x509/X509V2CRLGenerator.cs b/crypto/src/x509/X509V2CRLGenerator.cs index 4cfd1b6d9..6c9ffe7e5 100644 --- a/crypto/src/x509/X509V2CRLGenerator.cs +++ b/crypto/src/x509/X509V2CRLGenerator.cs @@ -134,7 +134,7 @@ namespace Org.BouncyCastle.X509 /// Set the signature algorithm that will be used to sign this CRL. /// </summary> /// <param name="signatureAlgorithm"/> - [Obsolete("Not needed if Generate used with an ISignatureCalculatorFactory")] + [Obsolete("Not needed if Generate used with an ISignatureFactory")] public void SetSignatureAlgorithm( string signatureAlgorithm) { @@ -203,7 +203,7 @@ namespace Org.BouncyCastle.X509 /// </summary> /// <param name="privateKey">The private key of the issuer that is signing this certificate.</param> /// <returns>An X509Crl.</returns> - [Obsolete("Use Generate with an ISignatureCalculatorFactory")] + [Obsolete("Use Generate with an ISignatureFactory")] public X509Crl Generate( AsymmetricKeyParameter privateKey) { @@ -216,12 +216,12 @@ namespace Org.BouncyCastle.X509 /// <param name="privateKey">The private key of the issuer that is signing this certificate.</param> /// <param name="random">Your Secure Random instance.</param> /// <returns>An X509Crl.</returns> - [Obsolete("Use Generate with an ISignatureCalculatorFactory")] + [Obsolete("Use Generate with an ISignatureFactory")] public X509Crl Generate( AsymmetricKeyParameter privateKey, SecureRandom random) { - return Generate(new Asn1SignatureCalculatorFactory(signatureAlgorithm, privateKey, random)); + return Generate(new Asn1SignatureFactory(signatureAlgorithm, privateKey, random)); } /// <summary> @@ -229,7 +229,7 @@ namespace Org.BouncyCastle.X509 /// </summary> /// <param name="signatureCalculatorFactory">A signature calculator factory with the necessary algorithm details.</param> /// <returns>An X509Crl.</returns> - public X509Crl Generate(ISignatureCalculatorFactory signatureCalculatorFactory) + public X509Crl Generate(ISignatureFactory signatureCalculatorFactory) { tbsGen.SetSignature((AlgorithmIdentifier)signatureCalculatorFactory.AlgorithmDetails); diff --git a/crypto/src/x509/X509V3CertificateGenerator.cs b/crypto/src/x509/X509V3CertificateGenerator.cs index f19016f84..51488bd2a 100644 --- a/crypto/src/x509/X509V3CertificateGenerator.cs +++ b/crypto/src/x509/X509V3CertificateGenerator.cs @@ -112,7 +112,7 @@ namespace Org.BouncyCastle.X509 /// Set the signature algorithm that will be used to sign this certificate. /// </summary> /// <param name="signatureAlgorithm"/> - [Obsolete("Not needed if Generate used with an ISignatureCalculatorFactory")] + [Obsolete("Not needed if Generate used with an ISignatureFactory")] public void SetSignatureAlgorithm( string signatureAlgorithm) { @@ -277,7 +277,7 @@ namespace Org.BouncyCastle.X509 /// </summary> /// <param name="privateKey">The private key of the issuer that is signing this certificate.</param> /// <returns>An X509Certificate.</returns> - [Obsolete("Use Generate with an ISignatureCalculatorFactory")] + [Obsolete("Use Generate with an ISignatureFactory")] public X509Certificate Generate( AsymmetricKeyParameter privateKey) { @@ -290,12 +290,12 @@ namespace Org.BouncyCastle.X509 /// <param name="privateKey">The private key of the issuer that is signing this certificate.</param> /// <param name="random">You Secure Random instance.</param> /// <returns>An X509Certificate.</returns> - [Obsolete("Use Generate with an ISignatureCalculatorFactory")] + [Obsolete("Use Generate with an ISignatureFactory")] public X509Certificate Generate( AsymmetricKeyParameter privateKey, SecureRandom random) { - return Generate(new Asn1SignatureCalculatorFactory(signatureAlgorithm, privateKey, random)); + return Generate(new Asn1SignatureFactory(signatureAlgorithm, privateKey, random)); } /// <summary> @@ -303,7 +303,7 @@ namespace Org.BouncyCastle.X509 /// </summary> /// <param name="signatureCalculatorFactory">A signature calculator factory with the necessary algorithm details.</param> /// <returns>An X509Certificate.</returns> - public X509Certificate Generate(ISignatureCalculatorFactory signatureCalculatorFactory) + public X509Certificate Generate(ISignatureFactory signatureCalculatorFactory) { tbsGen.SetSignature ((AlgorithmIdentifier)signatureCalculatorFactory.AlgorithmDetails); diff --git a/crypto/test/src/cms/test/SignedDataTest.cs b/crypto/test/src/cms/test/SignedDataTest.cs index 2c6f217da..89f7eea7d 100644 --- a/crypto/test/src/cms/test/SignedDataTest.cs +++ b/crypto/test/src/cms/test/SignedDataTest.cs @@ -532,9 +532,9 @@ namespace Org.BouncyCastle.Cms.Tests CmsSignedDataGenerator gen = new CmsSignedDataGenerator(); gen.AddSignerInfoGenerator(new SignerInfoGeneratorBuilder().Build( - new Asn1SignatureCalculatorFactory("SHA1withRSA", OrigKP.Private), OrigCert)); + new Asn1SignatureFactory("SHA1withRSA", OrigKP.Private), OrigCert)); gen.AddSignerInfoGenerator(new SignerInfoGeneratorBuilder().Build( - new Asn1SignatureCalculatorFactory("MD5withRSA", OrigKP.Private), OrigCert)); + new Asn1SignatureFactory("MD5withRSA", OrigKP.Private), OrigCert)); gen.AddCertificates(x509Certs); |