Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/quite/humla-spongycastle.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Hook <dgh@cryptoworkshop.com>2014-07-17 09:20:05 +0400
committerDavid Hook <dgh@cryptoworkshop.com>2014-07-17 09:20:05 +0400
commit09036e3ba3b18e64be9925579a1fa19925178ea2 (patch)
tree74a0c6bb48300b688b8e9d837ac0cad26a9eaeb5
parent012bbb4ac7c556e4d89eb91d31b91e61ccdeccfe (diff)
added method for taking raw byte array for extension encoding.
-rw-r--r--pkix/src/main/java/org/bouncycastle/cert/X509v2AttributeCertificateBuilder.java20
-rw-r--r--pkix/src/main/java/org/bouncycastle/cert/X509v2CRLBuilder.java20
2 files changed, 40 insertions, 0 deletions
diff --git a/pkix/src/main/java/org/bouncycastle/cert/X509v2AttributeCertificateBuilder.java b/pkix/src/main/java/org/bouncycastle/cert/X509v2AttributeCertificateBuilder.java
index 3ad87fa1..ba30aa8c 100644
--- a/pkix/src/main/java/org/bouncycastle/cert/X509v2AttributeCertificateBuilder.java
+++ b/pkix/src/main/java/org/bouncycastle/cert/X509v2AttributeCertificateBuilder.java
@@ -87,6 +87,26 @@ public class X509v2AttributeCertificateBuilder
return this;
}
+ /**
+ * Add a given extension field for the standard extensions tag (tag 3) using a byte encoding of the
+ * extension value.
+ *
+ * @param oid the OID defining the extension type.
+ * @param isCritical true if the extension is critical, false otherwise.
+ * @param encodedValue a byte array representing the encoding of the extension value.
+ * @return this builder object.
+ */
+ public X509v2AttributeCertificateBuilder addExtension(
+ ASN1ObjectIdentifier oid,
+ boolean isCritical,
+ byte[] encodedValue)
+ throws CertIOException
+ {
+ extGenerator.addExtension(oid, isCritical, encodedValue);
+
+ return this;
+ }
+
/**
* Generate an X509 certificate, based on the current issuer and subject
* using the passed in signer.
diff --git a/pkix/src/main/java/org/bouncycastle/cert/X509v2CRLBuilder.java b/pkix/src/main/java/org/bouncycastle/cert/X509v2CRLBuilder.java
index 0408c499..fe6dad62 100644
--- a/pkix/src/main/java/org/bouncycastle/cert/X509v2CRLBuilder.java
+++ b/pkix/src/main/java/org/bouncycastle/cert/X509v2CRLBuilder.java
@@ -161,6 +161,26 @@ public class X509v2CRLBuilder
}
/**
+ * Add a given extension field for the standard extensions tag (tag 3) using a byte encoding of the
+ * extension value.
+ *
+ * @param oid the OID defining the extension type.
+ * @param isCritical true if the extension is critical, false otherwise.
+ * @param encodedValue a byte array representing the encoding of the extension value.
+ * @return this builder object.
+ */
+ public X509v2CRLBuilder addExtension(
+ ASN1ObjectIdentifier oid,
+ boolean isCritical,
+ byte[] encodedValue)
+ throws CertIOException
+ {
+ extGenerator.addExtension(oid, isCritical, encodedValue);
+
+ return this;
+ }
+
+ /**
* Generate an X.509 CRL, based on the current issuer and subject
* using the passed in signer.
*