|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.cedarsoft.crypt.X509Support
public class X509Support
X509 Support
| Constructor Summary | |
|---|---|
X509Support(URL certificate)
Creates a new X509 support without any signing capabilities |
|
X509Support(URL certificate,
URL privateKey)
Creates a new X509 support |
|
X509Support(X509Certificate certificate)
Creates a new x509 support |
|
X509Support(X509Certificate certificate,
RSAPrivateKey privateKey)
Creates a new x509 support |
|
| Method Summary | |
|---|---|
byte[] |
cipher(byte[] plainText)
cipher |
byte[] |
decipher(byte[] bytes)
decipher |
X509Certificate |
getCertificate()
Returns the certificate |
RSAPrivateKey |
getPrivateKey()
Returns the private key (if there is one) |
boolean |
isPrivateKeyAvailable()
Returns whether the private key is available |
static X509Certificate |
readCertificate(URL certificateUrl)
Reads the x509 certificate from the given url |
static RSAPrivateKey |
readPrivateKey(URL privateKeyUrl)
Reads a private key form a url |
Signature |
sign(byte[] plainText)
sign |
boolean |
verifySignature(byte[] plainText,
Signature signature)
verifySignature |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public X509Support(@NotNull
URL certificate)
throws IOException,
GeneralSecurityException
certificate - the certificate
IOException - if any.
GeneralSecurityException - if any.
@Inject
public X509Support(@NotNull
URL certificate,
@Nullable
URL privateKey)
throws IOException,
GeneralSecurityException
certificate - the certificateprivateKey - the private key (if available)
IOException - if any.
GeneralSecurityException - if any.
public X509Support(@NotNull
X509Certificate certificate)
certificate - the certificate
public X509Support(@NotNull
X509Certificate certificate,
@Nullable
RSAPrivateKey privateKey)
certificate - the certificateprivateKey - the (optional) private key| Method Detail |
|---|
public boolean isPrivateKeyAvailable()
@NotNull
public byte[] cipher(@NotNull
byte[] plainText)
throws GeneralSecurityException
cipher
plainText - an array of byte.
GeneralSecurityException - if any.
@NotNull
public byte[] decipher(@NotNull
byte[] bytes)
throws GeneralSecurityException
decipher
bytes - an array of byte.
GeneralSecurityException - if any.
@NotNull
public Signature sign(@NotNull
byte[] plainText)
throws GeneralSecurityException
sign
plainText - an array of byte.
Signature object.
GeneralSecurityException - if any.
public boolean verifySignature(@NotNull
byte[] plainText,
@NotNull
Signature signature)
throws GeneralSecurityException
verifySignature
plainText - an array of byte.signature - a Signature object.
GeneralSecurityException - if any.@NotNull public X509Certificate getCertificate()
@NotNull public RSAPrivateKey getPrivateKey()
@Nullable
public static RSAPrivateKey readPrivateKey(@Nullable
URL privateKeyUrl)
throws IOException,
GeneralSecurityException
privateKeyUrl - the url containing the private key
IOException - if any.
GeneralSecurityException - if any.
@NotNull
public static X509Certificate readCertificate(@NotNull
URL certificateUrl)
throws IOException,
GeneralSecurityException
certificateUrl - the certificate url
IOException - if any.
GeneralSecurityException - if any.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||