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/BERApplicationSpecificParser.java')
-rw-r--r--core/src/main/java/org/spongycastle/asn1/BERApplicationSpecificParser.java41
1 files changed, 41 insertions, 0 deletions
diff --git a/core/src/main/java/org/spongycastle/asn1/BERApplicationSpecificParser.java b/core/src/main/java/org/spongycastle/asn1/BERApplicationSpecificParser.java
new file mode 100644
index 00000000..b77f81d0
--- /dev/null
+++ b/core/src/main/java/org/spongycastle/asn1/BERApplicationSpecificParser.java
@@ -0,0 +1,41 @@
+package org.spongycastle.asn1;
+
+import java.io.IOException;
+
+public class BERApplicationSpecificParser
+ implements ASN1ApplicationSpecificParser
+{
+ private final int tag;
+ private final ASN1StreamParser parser;
+
+ BERApplicationSpecificParser(int tag, ASN1StreamParser parser)
+ {
+ this.tag = tag;
+ this.parser = parser;
+ }
+
+ public ASN1Encodable readObject()
+ throws IOException
+ {
+ return parser.readObject();
+ }
+
+ public ASN1Primitive getLoadedObject()
+ throws IOException
+ {
+ return new BERApplicationSpecific(tag, parser.readVector());
+ }
+
+ public ASN1Primitive toASN1Primitive()
+ {
+ try
+ {
+ return getLoadedObject();
+ }
+ catch (IOException e)
+ {
+ throw new ASN1ParsingException(e.getMessage(), e);
+ }
+ }
+
+}