/** * Basic constructor - build from a string representing the token. * * @param token string representing the token. */ public AuthenticatorControl(String token) { this.token = new DERUTF8String(token); }
public SignerLocation( DERUTF8String countryName, DERUTF8String localityName, ASN1Sequence postalAddress) { if (postalAddress != null && postalAddress.size() > 6) { throw new IllegalArgumentException("postal address must contain less than 6 strings"); } if (countryName != null) { this.countryName = DERUTF8String.getInstance(countryName.toASN1Primitive()); } if (localityName != null) { this.localityName = DERUTF8String.getInstance(localityName.toASN1Primitive()); } if (postalAddress != null) { this.postalAddress = ASN1Sequence.getInstance(postalAddress.toASN1Primitive()); } }
public String toString() { return getString(); }
CertificateTrustBlock(byte[] encoded) { ASN1Sequence seq = ASN1Sequence.getInstance(encoded); for (Enumeration en = seq.getObjects(); en.hasMoreElements();) { ASN1Encodable obj = (ASN1Encodable)en.nextElement(); if (obj instanceof ASN1Sequence) { this.uses = ASN1Sequence.getInstance(obj); } else if (obj instanceof ASN1TaggedObject) { this.prohibitions = ASN1Sequence.getInstance((ASN1TaggedObject)obj, false); } else if (obj instanceof DERUTF8String) { this.alias = DERUTF8String.getInstance(obj).getString(); } } }
/** * Return an UTF8 String from a tagged object. * * @param obj * the tagged object holding the object we want * @param explicit * true if the object is meant to be explicitly tagged false * otherwise. * @exception IllegalArgumentException * if the tagged object cannot be converted. * @return a DERUTF8String instance, or null */ public static DERUTF8String getInstance( ASN1TaggedObject obj, boolean explicit) { ASN1Primitive o = obj.getObject(); if (explicit || o instanceof DERUTF8String) { return getInstance(o); } else { return new DERUTF8String(ASN1OctetString.getInstance(o).getOctets()); } }
this.statusString = DERUTF8String.getInstance(seq.getObjectAt(2)); this.otherInfo = OtherInfo.getInstance(seq.getObjectAt(3)); this.statusString = DERUTF8String.getInstance(seq.getObjectAt(2)); this.otherInfo = null; this.otherInfo = OtherInfo.getInstance(seq.getObjectAt(2));
/** * Return an UTF8 string from the passed in object. * * @param obj a DERUTF8String or an object that can be converted into one. * @exception IllegalArgumentException * if the object cannot be converted. * @return a DERUTF8String instance, or null */ public static DERUTF8String getInstance(Object obj) { if (obj == null || obj instanceof DERUTF8String) { return (DERUTF8String)obj; } if (obj instanceof byte[]) { try { return (DERUTF8String)fromByteArray((byte[])obj); } catch (Exception e) { throw new IllegalArgumentException("encoding error in getInstance: " + e.toString()); } } throw new IllegalArgumentException("illegal object in getInstance: " + obj.getClass().getName()); }
CertificateTrustBlock(byte[] encoded) { ASN1Sequence seq = ASN1Sequence.getInstance(encoded); for (Enumeration en = seq.getObjects(); en.hasMoreElements();) { ASN1Encodable obj = (ASN1Encodable)en.nextElement(); if (obj instanceof ASN1Sequence) { this.uses = ASN1Sequence.getInstance(obj); } else if (obj instanceof ASN1TaggedObject) { this.prohibitions = ASN1Sequence.getInstance((ASN1TaggedObject)obj, false); } else if (obj instanceof DERUTF8String) { this.alias = DERUTF8String.getInstance(obj).getString(); } } }
/** * return an UTF8 String from a tagged object. * * @param obj * the tagged object holding the object we want * @param explicit * true if the object is meant to be explicitly tagged false * otherwise. * @exception IllegalArgumentException * if the tagged object cannot be converted. */ public static DERUTF8String getInstance( ASN1TaggedObject obj, boolean explicit) { ASN1Primitive o = obj.getObject(); if (explicit || o instanceof DERUTF8String) { return getInstance(o); } else { return new DERUTF8String(ASN1OctetString.getInstance(o).getOctets()); } }
/** * constructor */ private ContentHints(ASN1Sequence seq) { ASN1Encodable field = seq.getObjectAt(0); if (field.toASN1Primitive() instanceof DERUTF8String) { contentDescription = DERUTF8String.getInstance(field); contentType = ASN1ObjectIdentifier.getInstance(seq.getObjectAt(1)); } else { contentType = ASN1ObjectIdentifier.getInstance(seq.getObjectAt(0)); } }
/** * Basic constructor - build from a string representing the token. * * @param token string representing the token. */ public AuthenticatorControl(String token) { this.token = new DERUTF8String(token); }
private ObjectData(ASN1Sequence seq) { this.type = ASN1Integer.getInstance(seq.getObjectAt(0)).getValue(); this.identifier = DERUTF8String.getInstance(seq.getObjectAt(1)).getString(); this.creationDate = ASN1GeneralizedTime.getInstance(seq.getObjectAt(2)); this.lastModifiedDate = ASN1GeneralizedTime.getInstance(seq.getObjectAt(3)); this.data = ASN1OctetString.getInstance(seq.getObjectAt(4)); this.comment = (seq.size() == 6) ? DERUTF8String.getInstance(seq.getObjectAt(5)).getString() : null; }
/** * constructor */ private ContentHints(ASN1Sequence seq) { ASN1Encodable field = seq.getObjectAt(0); if (field.toASN1Primitive() instanceof DERUTF8String) { contentDescription = DERUTF8String.getInstance(field); contentType = ASN1ObjectIdentifier.getInstance(seq.getObjectAt(1)); } else { contentType = ASN1ObjectIdentifier.getInstance(seq.getObjectAt(0)); } }
public String toString() { return getString(); }
/** * Basic constructor - build from a string representing the token. * * @param token string representing the token. */ public RegTokenControl(String token) { this.token = new DERUTF8String(token); }
private ObjectStoreData(ASN1Sequence seq) { this.version = ASN1Integer.getInstance(seq.getObjectAt(0)).getValue(); this.integrityAlgorithm = AlgorithmIdentifier.getInstance(seq.getObjectAt(1)); this.creationDate = ASN1GeneralizedTime.getInstance(seq.getObjectAt(2)); this.lastModifiedDate = ASN1GeneralizedTime.getInstance(seq.getObjectAt(3)); this.objectDataSequence = ObjectDataSequence.getInstance(seq.getObjectAt(4)); this.comment = (seq.size() == 6) ? DERUTF8String.getInstance(seq.getObjectAt(5)).getString() : null; }
this.statusString = DERUTF8String.getInstance(seq.getObjectAt(2)); this.otherStatusInfo = OtherStatusInfo.getInstance(seq.getObjectAt(3)); this.statusString = DERUTF8String.getInstance(seq.getObjectAt(2)); this.otherStatusInfo = null;
public String getStatusString() { if (resp.getStatus().getStatusString() != null) { StringBuffer statusStringBuf = new StringBuffer(); PKIFreeText text = resp.getStatus().getStatusString(); for (int i = 0; i != text.size(); i++) { statusStringBuf.append(text.getStringAt(i).getString()); } return statusStringBuf.toString(); } else { return null; } }
public PKIFreeText( String p) { this(new DERUTF8String(p)); }
/** * Return a control value of the specified type. * * @param type the type OID for the control value we are checking for. * @return the control value if present, null otherwise. */ public Control getControl(ASN1ObjectIdentifier type) { AttributeTypeAndValue found = findControl(type); if (found != null) { if (found.getType().equals(CRMFObjectIdentifiers.id_regCtrl_pkiArchiveOptions)) { return new PKIArchiveControl(PKIArchiveOptions.getInstance(found.getValue())); } if (found.getType().equals(CRMFObjectIdentifiers.id_regCtrl_regToken)) { return new RegTokenControl(DERUTF8String.getInstance(found.getValue())); } if (found.getType().equals(CRMFObjectIdentifiers.id_regCtrl_authenticator)) { return new AuthenticatorControl(DERUTF8String.getInstance(found.getValue())); } } return null; }