summaryrefslogtreecommitdiffstats
path: root/base/util/src/netscape/security/pkcs/PKCS12KeyInfo.java
diff options
context:
space:
mode:
Diffstat (limited to 'base/util/src/netscape/security/pkcs/PKCS12KeyInfo.java')
-rw-r--r--base/util/src/netscape/security/pkcs/PKCS12KeyInfo.java19
1 files changed, 19 insertions, 0 deletions
diff --git a/base/util/src/netscape/security/pkcs/PKCS12KeyInfo.java b/base/util/src/netscape/security/pkcs/PKCS12KeyInfo.java
index f180cf23b..ddcc3dbbc 100644
--- a/base/util/src/netscape/security/pkcs/PKCS12KeyInfo.java
+++ b/base/util/src/netscape/security/pkcs/PKCS12KeyInfo.java
@@ -21,6 +21,17 @@ import java.math.BigInteger;
import org.mozilla.jss.crypto.PrivateKey;
+/**
+ * This object is used for carrying key info around.
+ *
+ * It does not handle raw key material (but it used to).
+ *
+ * FIXME: A clear refactoring opportunity exists. The 'privateKey'
+ * field (and associated constructor) is only used during export,
+ * and the 'epkiBytes' field (and associated constructor) is only
+ * used during import. Therefore this should be two different
+ * types.
+ */
public class PKCS12KeyInfo {
private PrivateKey privateKey;
@@ -31,10 +42,18 @@ public class PKCS12KeyInfo {
public PKCS12KeyInfo() {
}
+ /**
+ * Construct with a PrivateKey. This constructor is used
+ * for moving the PrivateKey handle around during export.
+ */
public PKCS12KeyInfo(PrivateKey k) {
this.privateKey = k;
}
+ /** Construct with a (serialised) EncrypedPrivateKeyInfo. This
+ * constructor is used for moving the EPKI data around during
+ * import.
+ */
public PKCS12KeyInfo(byte[] epkiBytes) {
this.epkiBytes = epkiBytes;
}