SEQUENCE { userCertificate CertificateSerialNumber, revocationDate Time, crlEntryExtensions Extensions OPTIONAL -- if present, must be v2 }
322323324325326327328329330331332333
* The <code>SignerInfo</code> to add. * @throws NullPointerException * if the <code>info</code> is <code>null</code>. */ public void addSignerInfo(SignerInfo info) { AlgorithmIdentifier idn; AlgorithmIdentifier idv; Iterator i; if (info == null) { throw new NullPointerException("Need a SignerInfo!"); }
221222223224225226227228229230231232233234235236237238239
seq.add(serial_); add(seq); /* Digest Algorithm Identifier */ dAlg_ = new AlgorithmIdentifier(); add(dAlg_); /* Authenticated Attributes */ auth_ = new Attributes(); add(new ASN1TaggedType(0, auth_, false, true)); /* Digest Encryption Algorithm Identifier */ cAlg_ = new AlgorithmIdentifier(); add(cAlg_); /* Encrypted Digest */ edig_ = new ASN1OctetString(); add(edig_);
270271272273274275276277278279280281282283284285286287288
seq.add(serial_); add(seq); /* Digest Algorithm Identifier */ dAlg_ = new AlgorithmIdentifier(); add(dAlg_); /* Authenticated Attributes */ auth_ = new Attributes(registry); add(new ASN1TaggedType(0, auth_, false, true)); /* Digest Encryption Algorithm Identifier */ cAlg_ = new AlgorithmIdentifier(); add(cAlg_); /* Encrypted Digest */ edig_ = new ASN1OctetString(); add(edig_);
356357358359360361362363364365366367368
if (d == null || c == null) { throw new NoSuchAlgorithmException( "Cannot resolve signature algorithm!"); } try { dAlg_ = new AlgorithmIdentifier(new ASN1ObjectIdentifier(d), new ASN1Null()); cAlg_ = new AlgorithmIdentifier(new ASN1ObjectIdentifier(c), new ASN1Null()); } catch (ASN1Exception e) { throw new InconsistentStateException(e); } /* Digest Algorithm Identifier */
429430431432433434435436437438439440441
514515516517518519520521522523524525
s = JCA.getOID(algorithm); if (s == null) { throw new NoSuchAlgorithmException( "Cannot resolve signature algorithm!"); } dAlg_ = new AlgorithmIdentifier(s, params); cAlg_ = new AlgorithmIdentifier(s); /* Digest Algorithm Identifier */ add(dAlg_); /* Authenticated Attributes */
590591592593594595596597598599600601
121122123124125126127128129130131
CertificateEncodingException { setOID(new ASN1ObjectIdentifier(EXTENSION_OID)); setCritical(false); syntax_ = new ASN1Sequence(2); hashAlgorithm_ = new AlgorithmIdentifier(); certificateHash_ = new ASN1OctetString(); syntax_.add(hashAlgorithm_); syntax_.add(certificateHash_);
178179180181182183184185186187188189190191192
public CertHashExtension(byte[] cert, String alg) throws ASN1Exception, GeneralSecurityException { if (cert == null) { throw new NullPointerException("cert"); } AlgorithmIdentifier aid; MessageDigest dig; byte[] buf; aid = new AlgorithmIdentifier(alg); dig = MessageDigest.getInstance(alg); buf = dig.digest(cert); syntax_ = new ASN1Sequence(2); hashAlgorithm_ = aid;
194195196197198199200201202203204
seq.add(issuer_); seq.add(serial_); add(seq); /* Key Encryption Algorithm Identifier */ cAlg_ = new AlgorithmIdentifier(); add(cAlg_); /* Encrypted Key */ ekey_ = new ASN1OctetString(); add(ekey_);