Inheritance: Asn1Encodable
コード例 #1
0
ファイル: CAdESProfileBES.cs プロジェクト: Gianluigi/dssnet
		private Attribute MakeSigningCertificateAttribute(SignatureParameters parameters)
		{
			try
			{
				byte[] certHash = DigestUtilities.CalculateDigest
                    (parameters.DigestAlgorithm.GetName(),
                    parameters.SigningCertificate.GetEncoded());
                    
				if (parameters.DigestAlgorithm == DigestAlgorithm.SHA1)
				{
					SigningCertificate sc = new SigningCertificate(new EssCertID(certHash));
					return new Attribute(PkcsObjectIdentifiers.IdAASigningCertificate, new DerSet(sc
						));
				}
				else
				{
					EssCertIDv2 essCert = new EssCertIDv2(new AlgorithmIdentifier(parameters.DigestAlgorithm
						.GetOid()), certHash);
					SigningCertificateV2 scv2 = new SigningCertificateV2(new EssCertIDv2[] { essCert }
						);
					return new Attribute(PkcsObjectIdentifiers.IdAASigningCertificateV2, new DerSet
						(scv2));
				}
			}
			catch (NoSuchAlgorithmException e)
			{
				throw new RuntimeException(e);
			}
			catch (CertificateException e)
			{
				throw new RuntimeException(e);
			}
		}
コード例 #2
0
		public EssCertIDv2[] GetCerts()
		{
			EssCertIDv2[] certIds = new EssCertIDv2[certs.Count];
			for (int i = 0; i != certs.Count; i++)
			{
				certIds[i] = EssCertIDv2.GetInstance(certs[i]);
			}
			return certIds;
		}
コード例 #3
0
		public override void PerformTest()
		{
			// check GetInstance on default algorithm.
			byte[] digest = new byte[32];
			EssCertIDv2 essCertIdv2 = new EssCertIDv2(
				new AlgorithmIdentifier(NistObjectIdentifiers.IdSha256), digest);
			Asn1Object asn1Object = essCertIdv2.ToAsn1Object();

			EssCertIDv2.GetInstance(asn1Object);
		}
コード例 #4
0
		public SigningCertificateV2(
			EssCertIDv2[]		certs,
			PolicyInformation[]	policies)
		{
			this.certs = new DerSequence(certs);

			if (policies != null)
			{
				this.policies = new DerSequence(policies);
			}
		}
コード例 #5
0
ファイル: TimeStampToken.cs プロジェクト: randombit/hacrypto
			internal CertID(EssCertIDv2 certID)
			{
				this.certIDv2 = certID;
				this.certID = null;
			}
コード例 #6
0
		public SigningCertificateV2(
			EssCertIDv2[] certs)
		{
			this.certs = new DerSequence(certs);
		}