|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.geronimo.util.CaUtils
public class CaUtils
This class implements some utility methods used by CA
Field Summary | |
---|---|
static int |
B64_LINE_SIZE
|
static String |
CERT_FOOTER
|
static String |
CERT_HEADER
|
static String |
CERT_REQ_HEADER
|
static String |
CERT_REQ_PUBLICKEY
|
static String |
CERT_REQ_PUBLICKEY_OBJ
|
static String |
CERT_REQ_SUBJECT
|
static String |
CERT_REQ_VERSION
|
static String |
PKAC_CHALLENGE
|
Constructor Summary | |
---|---|
CaUtils()
|
Method Summary | |
---|---|
static String |
base64Certificate(Certificate cert)
This method returns base64 encoded text of a given certificate. |
static String |
base64Text(byte[] data,
String header,
String footer,
int lineSize)
This method encodes a given byte array into base64 along with specified header and footers. |
static PublicKey |
getPublicKeyObject(SubjectPublicKeyInfo pubKeyInfo)
This method creates a java.security.PublicKey object based on the public key information given in SubjectPublicKeyInfo |
static X509Name |
getSubjectX509Name(Certificate cert)
This method returns a X509Name object corresponding to the subject in a given certificate |
static X509Name |
getX509Name(String cn,
String ou,
String o,
String l,
String st,
String c)
This method creates a X509Name object using the name attributes specified. |
static X509Name |
getX509Name(X500Principal principal)
This method returns a X509Name object corresponding to a given principal |
static Map |
processPKCS10Request(String certreq)
This method processes a certificate request and returns a map containing subject and public key in the request. |
static Map |
processSPKAC(String spkac)
This method processes a DER encoded SignedPublicKeyAndChallenge in base64 format. |
static void |
storeInBase64(OutputStream fout,
byte[] data,
String header,
String footer,
int lineSize)
This method encodes a given byte array into base64 along with specified header and footers and writes the output to a specified OutputStream. |
static void |
storeInBase64(String outfile,
byte[] data,
String header,
String footer,
int lineSize)
This method encodes a given byte array into base64 along with specified header and footers and writes the output to a specified file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String CERT_HEADER
public static final String CERT_FOOTER
public static final String CERT_REQ_HEADER
public static final int B64_LINE_SIZE
public static final String CERT_REQ_SUBJECT
public static final String CERT_REQ_PUBLICKEY
public static final String CERT_REQ_PUBLICKEY_OBJ
public static final String CERT_REQ_VERSION
public static final String PKAC_CHALLENGE
Constructor Detail |
---|
public CaUtils()
Method Detail |
---|
public static String base64Certificate(Certificate cert) throws CertificateEncodingException, Exception
cert
- The certificate that needs to be encoded in base64
CertificateEncodingException
Exception
public static String base64Text(byte[] data, String header, String footer, int lineSize) throws Exception
data
- The byte array to be encoded in base64header
- Header for base64 encoded textfooter
- Footer for base64 encoded textlineSize
- Maximum line size to split base64 encoded text if required
Exception
public static void storeInBase64(OutputStream fout, byte[] data, String header, String footer, int lineSize) throws Exception
fout
- Output stream to write the encoded textdata
- The byte array to be encoded in base64header
- Header for base64 encoded textfooter
- Footer for base64 encoded textlineSize
- Maximum line size to split base64 encoded text if required
Exception
public static void storeInBase64(String outfile, byte[] data, String header, String footer, int lineSize) throws Exception
outfile
- File name to write the output todata
- The byte array to be encoded in base64header
- Header for base64 encoded textfooter
- Footer for base64 encoded textlineSize
- Maximum line size to split base64 encoded text if required
Exception
public static PublicKey getPublicKeyObject(SubjectPublicKeyInfo pubKeyInfo) throws Exception
pubKeyInfo
- SubjectPublicKeyInfo instance containing the public key information.
Exception
public static X509Name getSubjectX509Name(Certificate cert) throws CertificateEncodingException, IOException
cert
- Certificate from which subject needs to be retrieved
CertificateEncodingException
IOException
public static X509Name getX509Name(X500Principal principal) throws CertificateEncodingException, IOException
CertificateEncodingException
IOException
public static Map processPKCS10Request(String certreq) throws InvalidKeyException, NoSuchAlgorithmException, NoSuchProviderException, SignatureException, Exception
certreq
- base64 encoded PKCS10 certificate request
InvalidKeyException
NoSuchAlgorithmException
NoSuchProviderException
SignatureException
Exception
public static Map processSPKAC(String spkac) throws IOException, NoSuchAlgorithmException, InvalidKeyException, SignatureException, Exception
spkac
- SignedPublicKeyAndChallenge in base64 text format
IOException
NoSuchAlgorithmException
InvalidKeyException
SignatureException
Exception
public static X509Name getX509Name(String cn, String ou, String o, String l, String st, String c)
cn
- Common Nameou
- Organization Unito
- Organizationl
- Localityst
- Statec
- Country
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |