use of org.mozilla.jss.netscape.security.util.DerOutputStream in project jss by dogtagpki.
the class InvalidityDateExtension 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();
if (this.extensionValue == null) {
this.extensionId = PKIXExtensions.InvalidityDate_Id;
this.critical = true;
encodeThis();
}
super.encode(tmp);
out.write(tmp.toByteArray());
}
use of org.mozilla.jss.netscape.security.util.DerOutputStream in project jss by dogtagpki.
the class IssuingDistributionPoint method setFullName.
/**
* Sets the <code>fullName</code> of the <code>DistributionPointName</code>. It may be set to <code>null</code>.
* If it is set to a non-null value, <code>relativeName</code> will be
* set to <code>null</code>, because at most one of these two attributes
* can be specified at a time.
*
* @exception GeneralNamesException If an error occurs encoding the
* name.
*/
public void setFullName(GeneralNames fullName) throws GeneralNamesException, IOException {
this.fullName = fullName;
if (fullName != null) {
// encode the name to catch any problems with it
DerOutputStream derOut = new DerOutputStream();
fullName.encode(derOut);
try {
ANY raw = new ANY(derOut.toByteArray());
ByteArrayOutputStream bos = new ByteArrayOutputStream();
raw.encodeWithAlternateTag(Tag.get(0), bos);
fullNameEncoding = new ANY(bos.toByteArray());
} catch (InvalidBERException e) {
// in DerOutputStream
throw new GeneralNamesException(e.toString());
}
this.relativeName = null;
}
}
use of org.mozilla.jss.netscape.security.util.DerOutputStream in project jss by dogtagpki.
the class CRLReasonExtension method encode.
/**
* Write the extension to the DerOutputStream.
*
* @param out the OutputStream to write the extension to.
* @exception IOException on encoding errors.
*/
@Override
public void encode(OutputStream out) throws IOException {
DerOutputStream tmp = new DerOutputStream();
if (this.extensionValue == null) {
encodeThis();
}
super.encode(tmp);
out.write(tmp.toByteArray());
}
use of org.mozilla.jss.netscape.security.util.DerOutputStream in project jss by dogtagpki.
the class CertificateIssuerExtension method encodeThis.
// Encode this extension
private void encodeThis() throws IOException {
DerOutputStream os = new DerOutputStream();
try {
names.encode(os);
} catch (GeneralNamesException e) {
throw new IOException(e);
}
this.extensionValue = os.toByteArray();
}
use of org.mozilla.jss.netscape.security.util.DerOutputStream in project jss by dogtagpki.
the class CertificateIssuerExtension method encode.
/**
* Write the extension to the OutputStream.
*
* @param out the OutputStream to write the extension to.
* @exception IOException on encoding error.
*/
@Override
public void encode(OutputStream out) throws IOException {
DerOutputStream tmp = new DerOutputStream();
if (extensionValue == null) {
extensionId = PKIXExtensions.CertificateIssuer_Id;
critical = false;
encodeThis();
}
super.encode(tmp);
out.write(tmp.toByteArray());
}
Aggregations