public static AttributeTypeAndValue getInstance(Object o) { if (o instanceof AttributeTypeAndValue) { return (AttributeTypeAndValue)o; } if (o != null) { return new AttributeTypeAndValue(ASN1Sequence.getInstance(o)); } return null; }
public AttributeTypeAndValue[] toAttributeTypeAndValueArray() { AttributeTypeAndValue[] result = new AttributeTypeAndValue[content.size()]; for (int i = 0; i != result.length; i++) { result[i] = AttributeTypeAndValue.getInstance(content.getObjectAt(i)); } return result; }
/** * 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; }
private AttributeTypeAndValue findControl(ASN1ObjectIdentifier type) { if (controls == null) { return null; } AttributeTypeAndValue[] tAndVs = controls.toAttributeTypeAndValueArray(); AttributeTypeAndValue found = null; for (int i = 0; i != tAndVs.length; i++) { if (tAndVs[i].getType().equals(type)) { found = tAndVs[i]; break; } } return found; }
/** * 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; }
private AttributeTypeAndValue findControl(ASN1ObjectIdentifier type) { if (controls == null) { return null; } AttributeTypeAndValue[] tAndVs = controls.toAttributeTypeAndValueArray(); AttributeTypeAndValue found = null; for (int i = 0; i != tAndVs.length; i++) { if (tAndVs[i].getType().equals(type)) { found = tAndVs[i]; break; } } return found; }
public static AttributeTypeAndValue getInstance(Object o) { if (o instanceof AttributeTypeAndValue) { return (AttributeTypeAndValue)o; } if (o != null) { return new AttributeTypeAndValue(ASN1Sequence.getInstance(o)); } return null; }
public AttributeTypeAndValue[] getRegInfo() { if (regInfo == null) { return null; } AttributeTypeAndValue[] results = new AttributeTypeAndValue[regInfo.size()]; for (int i = 0; i != results.length; i++) { results[i] = AttributeTypeAndValue.getInstance(regInfo.getObjectAt(i)); } return results; }
controlV.add(new AttributeTypeAndValue(control.getType(), control.getValue()));
public AttributeTypeAndValue[] toAttributeTypeAndValueArray() { AttributeTypeAndValue[] result = new AttributeTypeAndValue[content.size()]; for (int i = 0; i != result.length; i++) { result[i] = AttributeTypeAndValue.getInstance(content.getObjectAt(i)); } return result; }
controlV.add(new AttributeTypeAndValue(control.getType(), control.getValue()));
public AttributeTypeAndValue[] getRegInfo() { if (regInfo == null) { return null; } AttributeTypeAndValue[] results = new AttributeTypeAndValue[regInfo.size()]; for (int i = 0; i != results.length; i++) { results[i] = AttributeTypeAndValue.getInstance(regInfo.getObjectAt(i)); } return results; }