use of com.google.showcase.v1beta1.Sequence in project jss by dogtagpki.
the class AVA method encode.
@Override
public void encode(Tag implicit, OutputStream ostream) throws IOException {
SEQUENCE seq = new SEQUENCE();
seq.addElement(oid);
seq.addElement(value);
seq.encode(implicit, ostream);
}
use of com.google.showcase.v1beta1.Sequence in project jss by dogtagpki.
the class Attribute method encode.
@Override
public void encode(Tag implicit, OutputStream ostream) throws IOException {
SEQUENCE seq = new SEQUENCE();
seq.addElement(type);
seq.addElement(values);
seq.encode(implicit, ostream);
}
use of com.google.showcase.v1beta1.Sequence in project jss by dogtagpki.
the class PKCS12Util method createKeyBagAttrs.
SET createKeyBagAttrs(PKCS12KeyInfo keyInfo) throws Exception {
SET attrs = new SET();
String friendlyName = keyInfo.getFriendlyName();
logger.debug(" Friendly name: " + friendlyName);
SEQUENCE subjectAttr = new SEQUENCE();
subjectAttr.addElement(SafeBag.FRIENDLY_NAME);
SET subjectSet = new SET();
subjectSet.addElement(new BMPString(friendlyName));
subjectAttr.addElement(subjectSet);
attrs.addElement(subjectAttr);
byte[] keyID = keyInfo.getID();
SEQUENCE localKeyAttr = new SEQUENCE();
localKeyAttr.addElement(SafeBag.LOCAL_KEY_ID);
SET localKeySet = new SET();
localKeySet.addElement(new OCTET_STRING(keyID));
localKeyAttr.addElement(localKeySet);
attrs.addElement(localKeyAttr);
return attrs;
}
use of com.google.showcase.v1beta1.Sequence in project jss by dogtagpki.
the class PKCS12Util method getKeyInfos.
public void getKeyInfos(PKCS12 pkcs12, PFX pfx, Password password) throws Exception {
logger.debug("Load encrypted private keys:");
AuthenticatedSafes safes = pfx.getAuthSafes();
for (int i = 0; i < safes.getSize(); i++) {
SEQUENCE contents = safes.getSafeContentsAt(password, i);
for (int j = 0; j < contents.size(); j++) {
SafeBag bag = (SafeBag) contents.elementAt(j);
OBJECT_IDENTIFIER oid = bag.getBagType();
if (!oid.equals(SafeBag.PKCS8_SHROUDED_KEY_BAG))
continue;
logger.debug(" - Private key:");
PKCS12KeyInfo keyInfo = getKeyInfo(bag, password);
pkcs12.addKeyInfo(keyInfo);
}
}
}
use of com.google.showcase.v1beta1.Sequence 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);
}
Aggregations