|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.netserv.ipauth.util.CryptoHelper
public class CryptoHelper
Constructor Summary | |
---|---|
CryptoHelper()
|
Method Summary | |
---|---|
static byte[] |
createNonce(int len)
Create Random Nonces |
static org.bouncycastle.asn1.DERObjectIdentifier |
createSigId(org.bouncycastle.asn1.DERObjectIdentifier encId,
org.bouncycastle.asn1.DERObjectIdentifier digestId)
Combine encryption algorithm and digest algorithm |
static java.lang.String[] |
getCommonNames(java.security.Principal name)
Converting Common Names to Strings |
static java.lang.String[] |
getCommonNames(org.bouncycastle.asn1.x509.X509Name name)
Converting Common Names to Strings |
static byte[] |
getGeneralName(org.bouncycastle.asn1.x509.GeneralName name)
Converting General Names to Byte String |
static void |
installBC()
Installing Bouncy Castle Provider |
static org.bouncycastle.asn1.x509.SubjectPublicKeyInfo |
PublicKeyToSubjectPublicKeyInfo(java.security.PublicKey publicKey)
Convert java.security.PublicKey objects to org.bouncycastle.asn1.x509.SubjectPublicKeyInfo objects |
static java.security.PublicKey |
SubjectPublicKeyInfoToPublicKey(org.bouncycastle.asn1.x509.SubjectPublicKeyInfo subjectPKInfo)
Convert org.bouncycastle.asn1.x509.SubjectPublicKeyInfo objects to java.security.PublicKey objects |
static java.security.cert.X509Certificate |
X509CertificateStructureToX509Certificate(org.bouncycastle.asn1.x509.X509CertificateStructure certstr)
Convert org.bouncycastle.asn1.x509.X509CertificateStructure objects to java.security.cert.X509Certificate object. |
static org.bouncycastle.asn1.x509.X509CertificateStructure |
X509CertificateToX509CertificateStructure(java.security.cert.X509Certificate cert)
Convert java.security.cert.X509Certificate objects to org.bouncycastle.asn1.x509.X509CertificateStructure objects. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CryptoHelper()
Method Detail |
---|
public static byte[] createNonce(int len)
len
- Length of nonces
public static org.bouncycastle.asn1.DERObjectIdentifier createSigId(org.bouncycastle.asn1.DERObjectIdentifier encId, org.bouncycastle.asn1.DERObjectIdentifier digestId)
encId
- encryption iddigestId
- digest id
public static java.lang.String[] getCommonNames(java.security.Principal name)
name
- Principal object
public static java.lang.String[] getCommonNames(org.bouncycastle.asn1.x509.X509Name name)
name
- X509Name object
public static byte[] getGeneralName(org.bouncycastle.asn1.x509.GeneralName name) throws java.io.IOException
GeneralName ::= CHOICE { otherName [0] OtherName, rfc822Name [1] IA5String, dNSName [2] IA5String, x400Address [3] ORAddress, directoryName [4] Name, ediPartyName [5] EDIPartyName, uniformResourceIdentifier [6] IA5String, iPAddress [7] OCTET STRING, registeredID [8] OBJECT IDENTIFIER} OtherName ::= SEQUENCE { type-id OBJECT IDENTIFIER, value [0] EXPLICIT ANY DEFINED BY type-id } EDIPartyName ::= SEQUENCE { nameAssigner [0] DirectoryString OPTIONAL, partyName [1] DirectoryString } Name ::= CHOICE { RDNSequence }
name
- General Name
java.io.IOException
public static void installBC()
public static org.bouncycastle.asn1.x509.SubjectPublicKeyInfo PublicKeyToSubjectPublicKeyInfo(java.security.PublicKey publicKey) throws java.security.InvalidKeyException
publicKey
- PublicKey object
java.security.InvalidKeyException
- if the object cannot be encodedSubjectPublicKeyInfoToPublicKey
public static java.security.PublicKey SubjectPublicKeyInfoToPublicKey(org.bouncycastle.asn1.x509.SubjectPublicKeyInfo subjectPKInfo) throws java.security.KeyException
subjectPKInfo
- SubjectPublicKeyInfo object
java.security.KeyException
- if the object cannot be decodedPublicKeyToSubjectPublicKeyInfo
public static java.security.cert.X509Certificate X509CertificateStructureToX509Certificate(org.bouncycastle.asn1.x509.X509CertificateStructure certstr) throws java.security.cert.CertificateException
certstr
- X509Certificate object
java.security.cert.CertificateException
- if the object cannot be decodedpublic static org.bouncycastle.asn1.x509.X509CertificateStructure X509CertificateToX509CertificateStructure(java.security.cert.X509Certificate cert) throws java.security.cert.CertificateEncodingException
cert
- X509Certificate object
java.security.cert.CertificateEncodingException
- if the object cannot be encoded
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |