summaryrefslogtreecommitdiff
path: root/src/org/spongycastle/util/io/pem/PemObject.java
diff options
context:
space:
mode:
authorArne Schwabe <arne@rfc2549.org>2012-06-28 19:33:05 +0200
committerArne Schwabe <arne@rfc2549.org>2012-06-28 19:33:05 +0200
commit78172a10165a969b8c002b6bdcf9dc47fa6cd5f3 (patch)
treeaa4f487db9426822dd005b2fb8b5b677139ec6f9 /src/org/spongycastle/util/io/pem/PemObject.java
parent7cb22c98cc326aceb6a9672ebddc6988703dc1c8 (diff)
The 'be ready for Jelly Beans' commit
- fix concurrentaccess occuring on JB - JB does not allow to extract the private keys from the key storage, rewrite using the key storage to use JAVA API and the external-key management interface
Diffstat (limited to 'src/org/spongycastle/util/io/pem/PemObject.java')
-rw-r--r--src/org/spongycastle/util/io/pem/PemObject.java62
1 files changed, 62 insertions, 0 deletions
diff --git a/src/org/spongycastle/util/io/pem/PemObject.java b/src/org/spongycastle/util/io/pem/PemObject.java
new file mode 100644
index 00000000..6f7c79c5
--- /dev/null
+++ b/src/org/spongycastle/util/io/pem/PemObject.java
@@ -0,0 +1,62 @@
+package org.spongycastle.util.io.pem;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+@SuppressWarnings("all")
+public class PemObject
+ implements PemObjectGenerator
+{
+ private static final List EMPTY_LIST = Collections.unmodifiableList(new ArrayList());
+
+ private String type;
+ private List headers;
+ private byte[] content;
+
+ /**
+ * Generic constructor for object without headers.
+ *
+ * @param type pem object type.
+ * @param content the binary content of the object.
+ */
+ public PemObject(String type, byte[] content)
+ {
+ this(type, EMPTY_LIST, content);
+ }
+
+ /**
+ * Generic constructor for object with headers.
+ *
+ * @param type pem object type.
+ * @param headers a list of PemHeader objects.
+ * @param content the binary content of the object.
+ */
+ public PemObject(String type, List headers, byte[] content)
+ {
+ this.type = type;
+ this.headers = Collections.unmodifiableList(headers);
+ this.content = content;
+ }
+
+ public String getType()
+ {
+ return type;
+ }
+
+ public List getHeaders()
+ {
+ return headers;
+ }
+
+ public byte[] getContent()
+ {
+ return content;
+ }
+
+ public PemObject generate()
+ throws PemGenerationException
+ {
+ return this;
+ }
+}