From 584ed25bf4cb96121dc890861fd2a23ef2fafa29 Mon Sep 17 00:00:00 2001 From: "Raif S. Naffah" Date: Mon, 6 Feb 2006 18:42:51 +0000 Subject: 2006-02-07 Raif S. Naffah * gnu/java/security/provider/GnuDSAPublicKey.java (getEncoded): Use Registry constant. * gnu/java/security/provider/GnuDSAPrivateKey.java (getEncoded): Likewise. * gnu/java/security/provider/GnuRSAPrivateKey.java (getEncoded): Likewise. * gnu/java/security/provider/GnuRSAPublicKey.java (getEncoded): Likewise. * gnu/java/security/provider/EncodedKeyFactory.java (ID_DSA): Redefined in terms of Registry constant. (ID_DSA): Redefined in terms of Registry constant. (ID_DH): Redefined in terms of Registry constant. * gnu/java/security/Registry.java (X509_ENCODING): New constant. (PKCS8_ENCODING): Likewise. (ASN1_ENCODING): Likewise. (RAW_ENCODING_SHORT_NAME): Likewise. (X509_ENCODING_SORT_NAME): Likewise. (PKCS8_ENCODING_SHORT_NAME): Likewise. (ASN1_ENCODING_SHORT_NAME): Likewise. (X509_ENCODING_ID): Likewise. (PKCS8_ENCODING_ID): Likewise. (ASN1_ENCODING_ID): Likewise. (DSA_OID_STRING): Likewise. (RSA_OID_STRING): Likewise. (DH_OID_STRING): Likewise. --- gnu/java/security/Registry.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'gnu/java/security/Registry.java') diff --git a/gnu/java/security/Registry.java b/gnu/java/security/Registry.java index 030477a92..49be4be99 100644 --- a/gnu/java/security/Registry.java +++ b/gnu/java/security/Registry.java @@ -263,9 +263,28 @@ public interface Registry // String TMMH32 = "tmmh32"; // Format IDs used to identify how we externalise asymmetric keys .......... + // fully-qualified names of the supported codecs String RAW_ENCODING = "gnu.crypto.raw.format"; + String X509_ENCODING = "gnu.crypto.x509.format"; + String PKCS8_ENCODING = "gnu.crypto.pkcs8.format"; + String ASN1_ENCODING = "gnu.crypto.asn1.format"; + // short names of the same. used by JCE adapters + String RAW_ENCODING_SHORT_NAME = "RAW"; + String X509_ENCODING_SORT_NAME = "X.509"; + String PKCS8_ENCODING_SHORT_NAME = "PKCS#8"; + String ASN1_ENCODING_SHORT_NAME = "ASN.1"; + + // unique identifiers of the same int RAW_ENCODING_ID = 1; + int X509_ENCODING_ID = 2; + int PKCS8_ENCODING_ID = 3; + int ASN1_ENCODING_ID = 4; + + // OID strings used in encoding/decoding keys + String DSA_OID_STRING = "1.2.840.10040.4.1"; + String RSA_OID_STRING = "1.2.840.113549.1.1.1"; + String DH_OID_STRING = "1.2.840.10046.2.1"; // Magic bytes we generate/expect in externalised asymmetric keys .......... // the four bytes represent G (0x47) for GNU, 1 (0x01) for Raw format, -- cgit v1.2.1