Class X509PemStringsSecret
- java.lang.Object
-
- jadex.platform.service.security.auth.AbstractAuthenticationSecret
-
- jadex.platform.service.security.auth.AbstractX509PemSecret
-
- jadex.platform.service.security.auth.X509PemStringsSecret
-
- All Implemented Interfaces:
java.lang.Cloneable
public class X509PemStringsSecret extends AbstractX509PemSecret
Secret based on inline PEM-encoded X.509 certificates and key.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.StringcertThe local certificate.protected java.lang.StringkeyThe local certificate key.static java.lang.StringPREFIXPrefix used to encode secret type as strings.-
Fields inherited from class jadex.platform.service.security.auth.AbstractAuthenticationSecret
SECRET_TYPES
-
-
Constructor Summary
Constructors Constructor Description X509PemStringsSecret(java.lang.String encodedstring)X509PemStringsSecret(java.lang.String cert, java.lang.String key)Creates the secret.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanSign()Tests if the secret can be used for signing or, alternatively, verification only.booleanequals(java.lang.Object obj)Equals.inthashCode()Hashcode.java.io.InputStreamopenCertificate()Opens the local certificate.java.io.InputStreamopenPrivateKey()Opens the private key used for signing.java.lang.StringtoString()Converts to encoded string.-
Methods inherited from class jadex.platform.service.security.auth.AbstractAuthenticationSecret
clone, fromKeyPair, fromString, fromString, main
-
-
-
-
Field Detail
-
PREFIX
public static final java.lang.String PREFIX
Prefix used to encode secret type as strings.- See Also:
- Constant Field Values
-
cert
protected java.lang.String cert
The local certificate.
-
key
protected java.lang.String key
The local certificate key.
-
-
Constructor Detail
-
X509PemStringsSecret
public X509PemStringsSecret(java.lang.String encodedstring)
-
X509PemStringsSecret
public X509PemStringsSecret(java.lang.String cert, java.lang.String key)Creates the secret.- Parameters:
cacert- Path to the trust anchor certificate.cert- Path to the local certificate.key- Path to the local certificate key.
-
-
Method Detail
-
canSign
public boolean canSign()
Tests if the secret can be used for signing or, alternatively, verification only.- Specified by:
canSignin classAbstractAuthenticationSecret- Returns:
- True, if the secret can be used for signing.
-
openCertificate
public java.io.InputStream openCertificate()
Opens the local certificate.- Specified by:
openCertificatein classAbstractX509PemSecret- Returns:
- The local certificate.
-
openPrivateKey
public java.io.InputStream openPrivateKey()
Opens the private key used for signing.- Specified by:
openPrivateKeyin classAbstractX509PemSecret- Returns:
- The private key.
-
hashCode
public int hashCode()
Hashcode.- Overrides:
hashCodein classAbstractAuthenticationSecret
-
equals
public boolean equals(java.lang.Object obj)
Equals.- Overrides:
equalsin classAbstractAuthenticationSecret
-
toString
public java.lang.String toString()
Converts to encoded string.- Overrides:
toStringin classjava.lang.Object
-
-