use of org.mozilla.jss.netscape.security.util.DerOutputStream in project jss by dogtagpki.
the class OCSPNoCheckExtension method encode.
@Override
public void encode(OutputStream out) throws CertificateException, IOException {
if (mCached == null) {
DerOutputStream temp = new DerOutputStream();
encode(temp);
}
out.write(mCached);
}
use of org.mozilla.jss.netscape.security.util.DerOutputStream in project jss by dogtagpki.
the class ContentInfo method encode.
public void encode(DerOutputStream out) throws IOException {
DerOutputStream contentDerCode;
DerOutputStream seq;
DerValue taggedContent;
contentDerCode = new DerOutputStream();
content.encode(contentDerCode);
// Add the [0] EXPLICIT tag in front of the content encoding
taggedContent = new DerValue((byte) 0xA0, contentDerCode.toByteArray());
seq = new DerOutputStream();
seq.putOID(contentType);
seq.putDerValue(taggedContent);
out.write(DerValue.tag_Sequence, seq);
}
use of org.mozilla.jss.netscape.security.util.DerOutputStream in project jss by dogtagpki.
the class NSCertTypeExtension method encode.
/**
* Write the extension to the DerOutputStream.
*
* @param out the DerOutputStream to write the extension to.
* @exception IOException on encoding errors.
*/
@Override
public void encode(OutputStream out) throws IOException {
DerOutputStream tmp = new DerOutputStream();
encodeThis();
if (this.extensionValue == null) {
this.extensionId = CertType_Id;
this.critical = true;
}
super.encode(tmp);
out.write(tmp.toByteArray());
}
use of org.mozilla.jss.netscape.security.util.DerOutputStream in project jss by dogtagpki.
the class CertificateScopeOfUseExtension method encodeThis.
private void encodeThis() throws IOException {
try (DerOutputStream seq = new DerOutputStream();
DerOutputStream tmp = new DerOutputStream()) {
if (mEntries == null)
throw new IOException("Invalid Scope Entries");
for (int i = 0; i < mEntries.size(); i++) {
CertificateScopeEntry se = mEntries.elementAt(i);
se.encode(tmp);
}
seq.write(DerValue.tag_Sequence, tmp);
this.extensionValue = seq.toByteArray();
}
}
use of org.mozilla.jss.netscape.security.util.DerOutputStream in project jss by dogtagpki.
the class GenericASN1Extension method encode.
/**
* Write the extension to the DerOutputStream.
*
* @param out the DerOutputStream to write the extension to.
* @exception IOException on encoding errors.
*/
@Override
public void encode(OutputStream out) throws IOException {
DerOutputStream tmp = new DerOutputStream();
try {
if (this.extensionValue == null) {
this.extensionId = new ObjectIdentifier(OID);
this.critical = true;
encodeThis();
}
} catch (ParseException e) {
}
super.encode(tmp);
out.write(tmp.toByteArray());
}
Aggregations