diff options
| author | Mark Benvenuto <mcb54@columbia.edu> | 1999-11-19 02:15:06 +0000 |
|---|---|---|
| committer | Mark Benvenuto <mcb54@columbia.edu> | 1999-11-19 02:15:06 +0000 |
| commit | 62694a418b7c541be7dd6eb34c5dbd62b5b1836b (patch) | |
| tree | 4341eb058c8eb64bbd99ec9b609f0bb49056fe25 /java/security/cert | |
| parent | 0da3e7423e79828115a3dcc3de9de825edd35251 (diff) | |
| download | classpath-62694a418b7c541be7dd6eb34c5dbd62b5b1836b.tar.gz | |
Updated the AUTHORS file so I am reflected as an author. Commited some JDK 1.3 Beta updates to java.security
Diffstat (limited to 'java/security/cert')
| -rw-r--r-- | java/security/cert/Certificate.java | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/java/security/cert/Certificate.java b/java/security/cert/Certificate.java index 4a977b436..e27a796af 100644 --- a/java/security/cert/Certificate.java +++ b/java/security/cert/Certificate.java @@ -22,6 +22,9 @@ import java.security.NoSuchAlgorithmException; import java.security.InvalidKeyException;
import java.security.NoSuchProviderException;
import java.security.SignatureException;
+import java.io.ObjectInputStream;
+import java.io.ByteArrayInputStream;
+import java.io.ObjectStreamException;
/**
The Certificate class is an abstract class used to manage
@@ -179,4 +182,47 @@ public abstract String toString(); */
public abstract PublicKey getPublicKey();
+
+/* INNER CLASS */
+/**
+ Certificate.CertificateRep is an inner class used to provide an alternate
+ storage mechanism for serialized Certificates.
+ */
+protected static class CertificateRep implements java.io.Serializable
+{
+ private String type;
+ private byte[] data;
+
+ /**
+ Create an alternate Certificate class to store a serialized Certificate
+
+ @param type the name of certificate type
+ @param data the certificate data
+ */
+ protected CertificateRep(String type,
+ byte[] data)
+ {
+ this.type = type;
+ this.data = data;
+ }
+
+ /**
+ Return the stored Certificate
+
+ @return the stored certificate
+
+ @throws ObjectStreamException if certificate cannot be resolved
+ */
+ protected Object readResolve()
+ throws ObjectStreamException
+ {
+ try {
+ return new ObjectInputStream( new ByteArrayInputStream( data ) ).readObject();
+ } catch ( Exception e ) {
+ e.printStackTrace();
+ throw new RuntimeException ( e.toString() );
+ }
+ }
+}
+
}
|
