use of org.mozilla.jss.asn1.Tag in project jss by dogtagpki.
the class Extension method encode.
@Override
public void encode(Tag implicit, OutputStream ostream) throws IOException {
SEQUENCE seq = new SEQUENCE();
seq.addElement(extnId);
if (critical == true) {
// false is default, so we only code true
seq.addElement(new BOOLEAN(true));
}
seq.addElement(extnValue);
seq.encode(implicit, ostream);
}
use of org.mozilla.jss.asn1.Tag in project jss by dogtagpki.
the class CMCStatusInfo method encode.
@Override
public void encode(Tag implicitTag, OutputStream ostream) throws IOException {
SEQUENCE seq = new SEQUENCE();
seq.addElement(status);
seq.addElement(bodyList);
if (statusString != null) {
seq.addElement(statusString);
}
if (otherInfo != null) {
seq.addElement(otherInfo);
}
seq.encode(implicitTag, ostream);
}
use of org.mozilla.jss.asn1.Tag in project jss by dogtagpki.
the class CertificateInfo method encode.
@Override
public void encode(Tag implicitTag, OutputStream ostream) throws IOException {
SEQUENCE seq = new SEQUENCE();
if (version != v1) {
// v1 is the default
seq.addElement(new EXPLICIT(new Tag(0), new INTEGER(version.getNumber())));
}
seq.addElement(serialNumber);
seq.addElement(signatureAlgId);
seq.addElement(issuer);
SEQUENCE validity = new SEQUENCE();
validity.addElement(encodeValidityDate(notBefore));
validity.addElement(encodeValidityDate(notAfter));
seq.addElement(validity);
seq.addElement(subject);
seq.addElement(subjectPublicKeyInfo);
if (issuerUniqueIdentifier != null) {
seq.addElement(new Tag(1), issuerUniqueIdentifier);
}
if (subjectUniqueIdentifier != null) {
seq.addElement(new Tag(2), subjectUniqueIdentifier);
}
if (extensions.size() > 0) {
seq.addElement(new EXPLICIT(new Tag(3), extensions));
}
seq.encode(implicitTag, ostream);
}
use of org.mozilla.jss.asn1.Tag in project jss by dogtagpki.
the class PFX method encode.
@Override
public void encode(Tag implicitTag, OutputStream ostream) throws IOException {
SEQUENCE seq = new SEQUENCE();
seq.addElement(version);
seq.addElement(new ContentInfo(ASN1Util.encode(authSafes)));
if (macData != null) {
seq.addElement(macData);
}
seq.encode(implicitTag, ostream);
}
use of org.mozilla.jss.asn1.Tag in project jss by dogtagpki.
the class SafeBag method encode.
@Override
public void encode(Tag implicitTag, OutputStream ostream) throws IOException {
SEQUENCE seq = new SEQUENCE();
seq.addElement(bagType);
seq.addElement(new EXPLICIT(new Tag(0), bagContent));
if (bagAttributes != null) {
seq.addElement(bagAttributes);
}
seq.encode(implicitTag, ostream);
}
Aggregations