use of org.xipki.ca.certprofile.x509.jaxb.ConstantValueType in project xipki by xipki.
the class ProfileConfCreatorDemo method createQcStatements.
private static ExtensionValueType createQcStatements(boolean requireRequestExt) {
QcStatements extValue = new QcStatements();
QcStatementType statement = new QcStatementType();
// QcCompliance
statement.setStatementId(createOidType(ObjectIdentifiers.id_etsi_qcs_QcCompliance));
extValue.getQcStatement().add(statement);
// QC SCD
statement = new QcStatementType();
statement.setStatementId(createOidType(ObjectIdentifiers.id_etsi_qcs_QcSSCD));
extValue.getQcStatement().add(statement);
// QC RetentionPeriod
statement = new QcStatementType();
statement.setStatementId(createOidType(ObjectIdentifiers.id_etsi_qcs_QcRetentionPeriod));
QcStatementValueType statementValue = new QcStatementValueType();
statementValue.setQcRetentionPeriod(10);
statement.setStatementValue(statementValue);
extValue.getQcStatement().add(statement);
// QC LimitValue
statement = new QcStatementType();
statement.setStatementId(createOidType(ObjectIdentifiers.id_etsi_qcs_QcLimitValue));
statementValue = new QcStatementValueType();
QcEuLimitValueType euLimit = new QcEuLimitValueType();
euLimit.setCurrency("EUR");
Range2Type rangeAmount = new Range2Type();
int min = 100;
rangeAmount.setMin(min);
rangeAmount.setMax(requireRequestExt ? 200 : min);
euLimit.setAmount(rangeAmount);
Range2Type rangeExponent = new Range2Type();
min = 10;
rangeExponent.setMin(min);
rangeExponent.setMax(requireRequestExt ? 20 : min);
euLimit.setExponent(rangeExponent);
statementValue.setQcEuLimitValue(euLimit);
statement.setStatementValue(statementValue);
extValue.getQcStatement().add(statement);
// QC PDS
statement = new QcStatementType();
statement.setStatementId(createOidType(ObjectIdentifiers.id_etsi_qcs_QcPDS));
extValue.getQcStatement().add(statement);
statementValue = new QcStatementValueType();
statement.setStatementValue(statementValue);
PdsLocationsType pdsLocations = new PdsLocationsType();
statementValue.setPdsLocations(pdsLocations);
PdsLocationType pdsLocation = new PdsLocationType();
pdsLocations.getPdsLocation().add(pdsLocation);
pdsLocation.setUrl("http://pki.example.org/pds/en");
pdsLocation.setLanguage("en");
pdsLocation = new PdsLocationType();
pdsLocations.getPdsLocation().add(pdsLocation);
pdsLocation.setUrl("http://pki.example.org/pds/de");
pdsLocation.setLanguage("de");
// QC Constant value
statement = new QcStatementType();
statement.setStatementId(createOidType(new ASN1ObjectIdentifier("1.2.3.4.5"), "dummy"));
statementValue = new QcStatementValueType();
ConstantValueType value = new ConstantValueType();
try {
value.setValue(DERNull.INSTANCE.getEncoded());
} catch (IOException ex) {
throw new RuntimeException(ex);
}
value.setDescription("DER NULL");
statementValue.setConstant(value);
statement.setStatementValue(statementValue);
extValue.getQcStatement().add(statement);
return createExtensionValueType(extValue);
}
use of org.xipki.ca.certprofile.x509.jaxb.ConstantValueType in project xipki by xipki.
the class ProfileConfCreatorDemo method createAuthorizationTemplate.
// method createBiometricInfo
private static ExtensionValueType createAuthorizationTemplate() {
AuthorizationTemplate extValue = new AuthorizationTemplate();
extValue.setType(createOidType(new ASN1ObjectIdentifier("1.2.3.4.5"), "dummy type"));
ConstantValueType accessRights = new ConstantValueType();
accessRights.setDescription("dummy access rights");
accessRights.setValue(new byte[] { 1, 2, 3, 4 });
extValue.setAccessRights(accessRights);
return createExtensionValueType(extValue);
}
Aggregations