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:
Diffstat (limited to 'core/src/main/java/org/spongycastle/asn1/BERFactory.java')
-rw-r--r--core/src/main/java/org/spongycastle/asn1/BERFactory.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/core/src/main/java/org/spongycastle/asn1/BERFactory.java b/core/src/main/java/org/spongycastle/asn1/BERFactory.java
new file mode 100644
index 00000000..a444eac6
--- /dev/null
+++ b/core/src/main/java/org/spongycastle/asn1/BERFactory.java
@@ -0,0 +1,17 @@
+package org.spongycastle.asn1;
+
+class BERFactory
+{
+ static final BERSequence EMPTY_SEQUENCE = new BERSequence();
+ static final BERSet EMPTY_SET = new BERSet();
+
+ static BERSequence createSequence(ASN1EncodableVector v)
+ {
+ return v.size() < 1 ? EMPTY_SEQUENCE : new BERSequence(v);
+ }
+
+ static BERSet createSet(ASN1EncodableVector v)
+ {
+ return v.size() < 1 ? EMPTY_SET : new BERSet(v);
+ }
+}