Class X509PemFilesSecret
- java.lang.Object
-
- jadex.platform.service.security.auth.AbstractAuthenticationSecret
-
- jadex.platform.service.security.auth.AbstractX509PemSecret
-
- jadex.platform.service.security.auth.X509PemFilesSecret
-
- All Implemented Interfaces:
java.lang.Cloneable
public class X509PemFilesSecret extends AbstractX509PemSecret
Secret based on PEM-encoded X.509 certificate files and key.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
cert
The local certificate.protected java.lang.String
key
The local certificate key.static java.lang.String
PREFIX
Prefix used to encode secret type as strings.-
Fields inherited from class jadex.platform.service.security.auth.AbstractAuthenticationSecret
SECRET_TYPES
-
-
Constructor Summary
Constructors Constructor Description X509PemFilesSecret(java.lang.String encodedstring)
X509PemFilesSecret(java.lang.String cert, java.lang.String key)
Creates the secret.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canSign()
Tests if the secret can be used for signing or, alternatively, verification only.boolean
equals(java.lang.Object obj)
Equals.int
hashCode()
Hashcode generation.java.io.InputStream
openCertificate()
Opens the local certificate.java.io.InputStream
openPrivateKey()
Opens the private key used for signing.java.lang.String
toString()
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
-
X509PemFilesSecret
public X509PemFilesSecret(java.lang.String encodedstring)
-
X509PemFilesSecret
public X509PemFilesSecret(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:
canSign
in classAbstractAuthenticationSecret
- Returns:
- True, if the secret can be used for signing.
-
openCertificate
public java.io.InputStream openCertificate()
Opens the local certificate.- Specified by:
openCertificate
in classAbstractX509PemSecret
- Returns:
- The local certificate.
-
openPrivateKey
public java.io.InputStream openPrivateKey()
Opens the private key used for signing.- Specified by:
openPrivateKey
in classAbstractX509PemSecret
- Returns:
- The private key.
-
hashCode
public int hashCode()
Hashcode generation.- Overrides:
hashCode
in classAbstractAuthenticationSecret
-
equals
public boolean equals(java.lang.Object obj)
Equals.- Overrides:
equals
in classAbstractAuthenticationSecret
-
toString
public java.lang.String toString()
Converts to encoded string.- Overrides:
toString
in classjava.lang.Object
-
-