| | |
| | | // Make sure that the DN specifies a certificate alias. |
| | | AttributeType t = |
| | | DirectoryServer.getAttributeType(ATTR_CRYPTO_KEY_ID, true); |
| | | AttributeValue v = entryDN.rdn().getAttributeValue(t); |
| | | ByteString v = entryDN.rdn().getAttributeValue(t); |
| | | if (v == null) |
| | | { |
| | | LocalizableMessage message = ERR_TRUSTSTORE_DN_DOES_NOT_SPECIFY_CERTIFICATE.get(entryDN); |
| | | throw new DirectoryException(ResultCode.CONSTRAINT_VIOLATION, message, baseDN, null); |
| | | } |
| | | |
| | | String certAlias = v.getValue().toString(); |
| | | String certAlias = v.toString(); |
| | | ByteString certValue; |
| | | try |
| | | { |
| | |
| | | true); |
| | | AttributeBuilder builder = new AttributeBuilder(t); |
| | | builder.setOption("binary"); |
| | | builder.add(AttributeValues.create(t, certValue)); |
| | | builder.add(certValue); |
| | | attrList = new ArrayList<Attribute>(1); |
| | | attrList.add(builder.toAttribute()); |
| | | userAttrs.put(t, attrList); |
| | |
| | | public static DN makeChildDN(DN parentDN, AttributeType rdnAttrType, |
| | | String rdnStringValue) |
| | | { |
| | | AttributeValue attrValue = |
| | | AttributeValues.create(rdnAttrType, rdnStringValue); |
| | | ByteString attrValue = ByteString.valueOf(rdnStringValue); |
| | | return parentDN.child(RDN.create(rdnAttrType, attrValue)); |
| | | } |
| | | |
| | |
| | | // Make sure that the DN specifies a certificate alias. |
| | | AttributeType t = |
| | | DirectoryServer.getAttributeType(ATTR_CRYPTO_KEY_ID, true); |
| | | AttributeValue v = entryDN.rdn().getAttributeValue(t); |
| | | ByteString v = entryDN.rdn().getAttributeValue(t); |
| | | if (v == null) |
| | | { |
| | | LocalizableMessage message = ERR_TRUSTSTORE_DN_DOES_NOT_SPECIFY_CERTIFICATE.get(entryDN); |
| | | throw new DirectoryException(ResultCode.CONSTRAINT_VIOLATION, message, baseDN, null); |
| | | } |
| | | String certAlias = v.getValue().toString(); |
| | | |
| | | String certAlias = v.toString(); |
| | | try |
| | | { |
| | | if (certificateManager.aliasInUse(certAlias)) |
| | |
| | | } |
| | | |
| | | Attribute certAttr = certAttrs.get(0); |
| | | Iterator<AttributeValue> i = certAttr.iterator(); |
| | | Iterator<ByteString> i = certAttr.iterator(); |
| | | |
| | | if (!i.hasNext()) |
| | | { |
| | |
| | | DirectoryServer.getServerErrorResultCode(), message); |
| | | } |
| | | |
| | | ByteString certBytes = i.next().getValue(); |
| | | ByteString certBytes = i.next(); |
| | | |
| | | if (i.hasNext()) |
| | | { |
| | |
| | | // Make sure that the DN specifies a certificate alias. |
| | | AttributeType t = |
| | | DirectoryServer.getAttributeType(ATTR_CRYPTO_KEY_ID, true); |
| | | AttributeValue v = entryDN.rdn().getAttributeValue(t); |
| | | ByteString v = entryDN.rdn().getAttributeValue(t); |
| | | if (v == null) |
| | | { |
| | | LocalizableMessage message = ERR_TRUSTSTORE_DN_DOES_NOT_SPECIFY_CERTIFICATE.get(entryDN); |
| | | throw new DirectoryException(ResultCode.CONSTRAINT_VIOLATION, message, baseDN, null); |
| | | } |
| | | String certAlias = v.getValue().toString(); |
| | | |
| | | String certAlias = v.toString(); |
| | | try |
| | | { |
| | | if (!certificateManager.aliasInUse(certAlias)) |
| | |
| | | throw new DirectoryException( |
| | | DirectoryServer.getServerErrorResultCode(), message, e); |
| | | } |
| | | |
| | | } |
| | | |
| | | |