|
||||||||||
| 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)
|
byte[] |
decipher(byte[] bytes)
|
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)
|
boolean |
verifySignature(byte[] plainText,
Signature signature)
|
| 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
GeneralSecurityException
@Inject
public X509Support(@NotNull
URL certificate,
@Nullable
URL privateKey)
throws IOException,
GeneralSecurityException
certificate - the certificateprivateKey - the private key (if available)
IOException
GeneralSecurityException
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
GeneralSecurityException
@NotNull
public byte[] decipher(@NotNull
byte[] bytes)
throws GeneralSecurityException
GeneralSecurityException
@NotNull
public Signature sign(@NotNull
byte[] plainText)
throws GeneralSecurityException
GeneralSecurityException
public boolean verifySignature(@NotNull
byte[] plainText,
@NotNull
Signature signature)
throws GeneralSecurityException
GeneralSecurityException@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
GeneralSecurityException
@NotNull
public static X509Certificate readCertificate(@NotNull
URL certificateUrl)
throws IOException,
GeneralSecurityException
certificateUrl - the certificate url
IOException
GeneralSecurityException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||