| | |
| | | // Construct the trust store base entry. |
| | | LinkedHashMap<ObjectClass,String> objectClasses = new LinkedHashMap<>(2); |
| | | objectClasses.put(CoreSchema.getTopObjectClass(), OC_TOP); |
| | | objectClasses.put(DirectoryServer.getSchema().getObjectClass("ds-cfg-branch"), "ds-cfg-branch"); |
| | | objectClasses.put(DirectoryServer.getInstance().getServerContext().getSchema().getObjectClass("ds-cfg-branch"), "ds-cfg-branch"); |
| | | |
| | | LinkedHashMap<AttributeType,List<Attribute>> userAttrs = new LinkedHashMap<>(1); |
| | | for (AVA ava : getBaseDN().rdn()) |
| | |
| | | throws DirectoryException |
| | | { |
| | | // Make sure that the DN specifies a certificate alias. |
| | | AttributeType t = DirectoryServer.getSchema().getAttributeType(ATTR_CRYPTO_KEY_ID); |
| | | AttributeType t = DirectoryServer.getInstance().getServerContext().getSchema().getAttributeType(ATTR_CRYPTO_KEY_ID); |
| | | ByteString v = entryDN.rdn().getAttributeValue(t); |
| | | if (v == null) |
| | | { |
| | |
| | | // Construct the certificate entry to return. |
| | | LinkedHashMap<ObjectClass,String> ocMap = new LinkedHashMap<>(2); |
| | | ocMap.put(CoreSchema.getTopObjectClass(), OC_TOP); |
| | | ocMap.put(DirectoryServer.getSchema().getObjectClass(OC_CRYPTO_INSTANCE_KEY), OC_CRYPTO_INSTANCE_KEY); |
| | | ocMap.put(DirectoryServer.getInstance().getServerContext().getSchema().getObjectClass(OC_CRYPTO_INSTANCE_KEY), OC_CRYPTO_INSTANCE_KEY); |
| | | |
| | | LinkedHashMap<AttributeType,List<Attribute>> opAttrs = new LinkedHashMap<>(0); |
| | | LinkedHashMap<AttributeType,List<Attribute>> userAttrs = new LinkedHashMap<>(3); |
| | | |
| | | userAttrs.put(t, Attributes.createAsList(t, v)); |
| | | |
| | | t = DirectoryServer.getSchema().getAttributeType(ATTR_CRYPTO_PUBLIC_KEY_CERTIFICATE); |
| | | t = DirectoryServer.getInstance().getServerContext().getSchema().getAttributeType(ATTR_CRYPTO_PUBLIC_KEY_CERTIFICATE); |
| | | AttributeBuilder builder = new AttributeBuilder(t); |
| | | builder.setOption("binary"); |
| | | builder.add(certValue); |
| | |
| | | |
| | | if (scope != SearchScope.BASE_OBJECT && aliases.length != 0) |
| | | { |
| | | AttributeType certAliasType = DirectoryServer.getSchema().getAttributeType(ATTR_CRYPTO_KEY_ID); |
| | | AttributeType certAliasType = DirectoryServer.getInstance().getServerContext().getSchema().getAttributeType(ATTR_CRYPTO_KEY_ID); |
| | | for (String alias : aliases) |
| | | { |
| | | DN certDN = makeChildDN(getBaseDN(), certAliasType, alias); |
| | |
| | | DN entryDN = entry.getName(); |
| | | |
| | | // Make sure that the DN specifies a certificate alias. |
| | | AttributeType t = DirectoryServer.getSchema().getAttributeType(ATTR_CRYPTO_KEY_ID); |
| | | AttributeType t = DirectoryServer.getInstance().getServerContext().getSchema().getAttributeType(ATTR_CRYPTO_KEY_ID); |
| | | ByteString v = entryDN.rdn().getAttributeValue(t); |
| | | if (v == null) |
| | | { |
| | |
| | | throw new DirectoryException(ResultCode.ENTRY_ALREADY_EXISTS, message); |
| | | } |
| | | |
| | | if (entry.hasObjectClass(DirectoryServer.getSchema().getObjectClass(OC_SELF_SIGNED_CERT_REQUEST))) |
| | | if (entry.hasObjectClass(DirectoryServer.getInstance().getServerContext().getSchema().getObjectClass(OC_SELF_SIGNED_CERT_REQUEST))) |
| | | { |
| | | try |
| | | { |
| | |
| | | throws DirectoryException |
| | | { |
| | | // Make sure that the DN specifies a certificate alias. |
| | | AttributeType t = DirectoryServer.getSchema().getAttributeType(ATTR_CRYPTO_KEY_ID); |
| | | AttributeType t = DirectoryServer.getInstance().getServerContext().getSchema().getAttributeType(ATTR_CRYPTO_KEY_ID); |
| | | ByteString v = entryDN.rdn().getAttributeValue(t); |
| | | if (v == null) |
| | | { |