Hello,
I tried adding the attribute types / object class at first with the
LdifFileLoader using
new LdifFileLoader(this.directoryService.getAdminSession(),
ldifFile).execute();
in my interceptor and the LDIF file
dn: m-oid=2.5.29.14, ou=attributetypes, cn=other, ou=schema
changetype: add
m-syntax: 1.3.6.1.4.1.1466.115.121.1.15
m-description: Unique key (except for hash collisions) for X.509
certificates
according to RFC 5280.
m-name: SubjectKeyIdentifier
m-ordering: caseIgnoreMatch
objectclass: metaAttributeType
objectclass: metaTop
objectclass: top
m-singleValue: TRUE
m-equality: caseIgnoreMatch
m-oid: 2.5.29.14
dn: m-oid=1.3.6.1.2.1.2.2.1.8, ou=attributetypes, cn=other, ou=schema
changetype: add
m-syntax: 1.3.6.1.4.1.1466.115.121.1.7
m-description: Indicates whether a certificate is revoked
m-name: revocation
m-ordering: booleanMatch
objectclass: metaAttributeType
objectclass: metaTop
objectclass: top
m-singleValue: TRUE
m-equality: booleanMatch
m-oid: 1.3.6.1.2.1.2.2.1.8
dn: m-oid=1.3.6.1.5.5.7, ou=objectclasses, cn=other, ou=schema
changetype: add
m-description: X.509 certificates as required due to the German BSI TR 03109
m-name: smpki
objectclass: metaObjectClass
objectclass: metaTop
objectclass: top
m-oid: 1.3.6.1.5.5.7
m-must: revocation
m-must: SubjectKeyIdentifier
m-must: userCertificate
Alternatively I tried using instead
MutableAttributeType subjectKeyIdentifierAttribute = new
MutableAttributeType("2.5.29.14");
subjectKeyIdentifierAttribute.setNames("SubjectKeyIdentifier");
subjectKeyIdentifierAttribute.setSingleValued(true);
MutableAttributeType revocationAttribute = new
MutableAttributeType("1.3.6.1.2.1.2.2.1.8");
revocationAttribute.setNames("revocation");
revocationAttribute.setSingleValued(true);
MutableObjectClass smpkiObjectClass = new
MutableObjectClass("1.3.6.1.5.5.7");
smpkiObjectClass.setNames("smpki");
smpkiObjectClass.addMustAttributeTypeOids(revocationAttribute.getOid(),
subjectKeyIdentifierAttribute.getOid(),
"2.5.4.36");
try {
this.directoryService.getSchemaManager().add(revocationAttribute);
this.directoryService.getSchemaManager().add(subjectKeyIdentifierAttribute);
this.directoryService.getSchemaManager().add(smpkiObjectClass);
} catch (LdapException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
but I'm still getting the NullPointerException.
With regards
Sebastian