/** * Add or replace an X.509 certificate extension. If an extension with the same OID already exists, it is replaced * and returned. * * @param extension the extension to add (must not be {@code null}) * @return the existing extension or {@code null} if no other extension with the same OID existed */ public X509CertificateExtension addOrReplaceExtension(X509CertificateExtension extension) { Assert.checkNotNullParam("extension", extension); final String oid = extension.getId(); Assert.checkNotNullParam("extension.getOid()", oid); return extensionsByOid.put(oid, extension); }
/** * Add or replace a certificate extension. If an extension with the same OID already exists, it is replaced * and returned. * * @param extension the extension to add (must not be {@code null}) * @return the existing extension, or {@code null} if no other extension with the same OID was existent */ public X509CertificateExtension addOrReplaceExtension(X509CertificateExtension extension) { Assert.checkNotNullParam("extension", extension); final String oid = extension.getId(); Assert.checkNotNullParam("extension.getOid()", oid); return extensionsByOid.put(oid, extension); }
/** * Add an X.509 certificate extension. If an extension with the same OID already exists, an exception is thrown. * * @param extension the extension to add (must not be {@code null}) * @return this builder instance * @throws IllegalArgumentException if an extension with the same OID has already been added */ public Builder addExtension(X509CertificateExtension extension) throws IllegalArgumentException { Assert.checkNotNullParam("extension", extension); final String oid = extension.getId(); Assert.checkNotNullParam("extension.getOid()", oid); if (extensionsByOid.putIfAbsent(oid, extension) != null) { throw log.extensionAlreadyExists(oid); } return this; }
/** * Add a certificate extension. If an extension with the same OID already exists, an exception is thrown. * * @param extension the extension to add (must not be {@code null}) * @return this builder instance */ public X509CertificateBuilder addExtension(X509CertificateExtension extension) { Assert.checkNotNullParam("extension", extension); final String oid = extension.getId(); Assert.checkNotNullParam("extension.getOid()", oid); if (extensionsByOid.putIfAbsent(oid, extension) != null) { throw log.extensionAlreadyExists(oid); } return this; }
/** * Add an X.509 certificate extension that should be included in the certificate signing request. * If an extension with the same OID already exists, an exception is thrown. * * @param extension the extension to add (must not be {@code null}) * @return this builder instance * @throws IllegalArgumentException if an extension with the same OID has already been added */ public Builder addExtension(X509CertificateExtension extension) throws IllegalArgumentException { Assert.checkNotNullParam("extension", extension); final String oid = extension.getId(); Assert.checkNotNullParam("extension.getOid()", oid); if (extensionsByOid.putIfAbsent(oid, extension) != null) { throw log.extensionAlreadyExists(oid); } return this; }
/** * Encode an {@code Extension} using the given DER encoder. The ASN.1 definition of {@code Extension} is: * * <pre> * Extension ::= SEQUENCE { * extensionId OBJECT IDENTIFIER, * critical BOOLEAN DEFAULT FALSE, * extensionValue OCTET STRING * } * </pre> * * @param encoder the DER encoder * @param extension the X.509 certificate extension */ private static void encodeExtension(final DEREncoder encoder, final X509CertificateExtension extension) { encoder.startSequence(); encoder.encodeObjectIdentifier(extension.getId()); if (extension.isCritical()) { encoder.encodeBoolean(true); } DEREncoder extensionEncoder = new DEREncoder(); extension.encodeTo(extensionEncoder); encoder.encodeOctetString(extensionEncoder.getEncoded()); encoder.endSequence(); }
for (X509CertificateExtension extension : extensionsByOid.values()) { derEncoder.startSequence(); derEncoder.encodeObjectIdentifier(extension.getId()); if (extension.isCritical()) derEncoder.encodeBoolean(true); final DEREncoder subEncoder = new DEREncoder();
/** * Add or replace an X.509 certificate extension. If an extension with the same OID already exists, it is replaced * and returned. * * @param extension the extension to add (must not be {@code null}) * @return the existing extension or {@code null} if no other extension with the same OID existed */ public X509CertificateExtension addOrReplaceExtension(X509CertificateExtension extension) { Assert.checkNotNullParam("extension", extension); final String oid = extension.getId(); Assert.checkNotNullParam("extension.getOid()", oid); return extensionsByOid.put(oid, extension); }
/** * Add or replace an X.509 certificate extension. If an extension with the same OID already exists, it is replaced * and returned. * * @param extension the extension to add (must not be {@code null}) * @return the existing extension or {@code null} if no other extension with the same OID existed */ public X509CertificateExtension addOrReplaceExtension(X509CertificateExtension extension) { Assert.checkNotNullParam("extension", extension); final String oid = extension.getId(); Assert.checkNotNullParam("extension.getOid()", oid); return extensionsByOid.put(oid, extension); }
/** * Add or replace an X.509 certificate extension. If an extension with the same OID already exists, it is replaced * and returned. * * @param extension the extension to add (must not be {@code null}) * @return the existing extension or {@code null} if no other extension with the same OID existed */ public X509CertificateExtension addOrReplaceExtension(X509CertificateExtension extension) { Assert.checkNotNullParam("extension", extension); final String oid = extension.getId(); Assert.checkNotNullParam("extension.getOid()", oid); return extensionsByOid.put(oid, extension); }
/** * Add or replace a certificate extension. If an extension with the same OID already exists, it is replaced * and returned. * * @param extension the extension to add (must not be {@code null}) * @return the existing extension, or {@code null} if no other extension with the same OID was existent */ public X509CertificateExtension addOrReplaceExtension(X509CertificateExtension extension) { Assert.checkNotNullParam("extension", extension); final String oid = extension.getId(); Assert.checkNotNullParam("extension.getOid()", oid); return extensionsByOid.put(oid, extension); }
/** * Add or replace a certificate extension. If an extension with the same OID already exists, it is replaced * and returned. * * @param extension the extension to add (must not be {@code null}) * @return the existing extension, or {@code null} if no other extension with the same OID was existent */ public X509CertificateExtension addOrReplaceExtension(X509CertificateExtension extension) { Assert.checkNotNullParam("extension", extension); final String oid = extension.getId(); Assert.checkNotNullParam("extension.getOid()", oid); return extensionsByOid.put(oid, extension); }
/** * Add or replace a certificate extension. If an extension with the same OID already exists, it is replaced * and returned. * * @param extension the extension to add (must not be {@code null}) * @return the existing extension, or {@code null} if no other extension with the same OID was existent */ public X509CertificateExtension addOrReplaceExtension(X509CertificateExtension extension) { Assert.checkNotNullParam("extension", extension); final String oid = extension.getId(); Assert.checkNotNullParam("extension.getOid()", oid); return extensionsByOid.put(oid, extension); }
/** * Add a certificate extension. If an extension with the same OID already exists, an exception is thrown. * * @param extension the extension to add (must not be {@code null}) * @return this builder instance */ public X509CertificateBuilder addExtension(X509CertificateExtension extension) { Assert.checkNotNullParam("extension", extension); final String oid = extension.getId(); Assert.checkNotNullParam("extension.getOid()", oid); if (extensionsByOid.putIfAbsent(oid, extension) != null) { throw log.extensionAlreadyExists(oid); } return this; }
/** * Add an X.509 certificate extension. If an extension with the same OID already exists, an exception is thrown. * * @param extension the extension to add (must not be {@code null}) * @return this builder instance * @throws IllegalArgumentException if an extension with the same OID has already been added */ public Builder addExtension(X509CertificateExtension extension) throws IllegalArgumentException { Assert.checkNotNullParam("extension", extension); final String oid = extension.getId(); Assert.checkNotNullParam("extension.getOid()", oid); if (extensionsByOid.putIfAbsent(oid, extension) != null) { throw log.extensionAlreadyExists(oid); } return this; }
/** * Add an X.509 certificate extension. If an extension with the same OID already exists, an exception is thrown. * * @param extension the extension to add (must not be {@code null}) * @return this builder instance * @throws IllegalArgumentException if an extension with the same OID has already been added */ public Builder addExtension(X509CertificateExtension extension) throws IllegalArgumentException { Assert.checkNotNullParam("extension", extension); final String oid = extension.getId(); Assert.checkNotNullParam("extension.getOid()", oid); if (extensionsByOid.putIfAbsent(oid, extension) != null) { throw log.extensionAlreadyExists(oid); } return this; }
/** * Add a certificate extension. If an extension with the same OID already exists, an exception is thrown. * * @param extension the extension to add (must not be {@code null}) * @return this builder instance */ public X509CertificateBuilder addExtension(X509CertificateExtension extension) { Assert.checkNotNullParam("extension", extension); final String oid = extension.getId(); Assert.checkNotNullParam("extension.getOid()", oid); if (extensionsByOid.putIfAbsent(oid, extension) != null) { throw log.extensionAlreadyExists(oid); } return this; }
/** * Add an X.509 certificate extension that should be included in the certificate signing request. * If an extension with the same OID already exists, an exception is thrown. * * @param extension the extension to add (must not be {@code null}) * @return this builder instance * @throws IllegalArgumentException if an extension with the same OID has already been added */ public Builder addExtension(X509CertificateExtension extension) throws IllegalArgumentException { Assert.checkNotNullParam("extension", extension); final String oid = extension.getId(); Assert.checkNotNullParam("extension.getOid()", oid); if (extensionsByOid.putIfAbsent(oid, extension) != null) { throw log.extensionAlreadyExists(oid); } return this; }
/** * Add a certificate extension. If an extension with the same OID already exists, an exception is thrown. * * @param extension the extension to add (must not be {@code null}) * @return this builder instance */ public X509CertificateBuilder addExtension(X509CertificateExtension extension) { Assert.checkNotNullParam("extension", extension); final String oid = extension.getId(); Assert.checkNotNullParam("extension.getOid()", oid); if (extensionsByOid.putIfAbsent(oid, extension) != null) { throw log.extensionAlreadyExists(oid); } return this; }
/** * Add an X.509 certificate extension. If an extension with the same OID already exists, an exception is thrown. * * @param extension the extension to add (must not be {@code null}) * @return this builder instance * @throws IllegalArgumentException if an extension with the same OID has already been added */ public Builder addExtension(X509CertificateExtension extension) throws IllegalArgumentException { Assert.checkNotNullParam("extension", extension); final String oid = extension.getId(); Assert.checkNotNullParam("extension.getOid()", oid); if (extensionsByOid.putIfAbsent(oid, extension) != null) { throw log.extensionAlreadyExists(oid); } return this; }