Package org.apache.tomcat.util.net
Class SSLHostConfigPreSharedKey
- java.lang.Object
-
- org.apache.tomcat.util.net.SSLHostConfigPreSharedKey
-
- All Implemented Interfaces:
java.io.Serializable
public class SSLHostConfigPreSharedKey extends java.lang.Object implements java.io.SerializableRepresents a pre-shared key configuration for a virtual host.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SSLHostConfigPreSharedKey()Creates a new pre-shared key configuration with default settings.SSLHostConfigPreSharedKey(SSLHostConfig sslHostConfig)Creates a new pre-shared key configuration for the given host.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetDigest()Returns the message digest algorithm name.MessageDigestgetDigestInternal()Returns the message digest.java.lang.StringgetIdentity()Returns the identity associated with the pre-shared key.java.lang.StringgetKey()Returns the pre-shared key as a hexadecimal string.byte[]getKeyInternal()Returns the pre-shared key.SSLHostConfiggetSSLHostConfig()Returns the SSLHostConfig that owns this pre-shared key configuration.voidsetDigest(java.lang.String digest)Sets the message digest algorithm.voidsetIdentity(java.lang.String identity)Sets the identity associated with the pre-shared key.voidsetKey(java.lang.String key)Sets the pre-shared key from a hexadecimal string.
-
-
-
Constructor Detail
-
SSLHostConfigPreSharedKey
public SSLHostConfigPreSharedKey()
Creates a new pre-shared key configuration with default settings.
-
SSLHostConfigPreSharedKey
public SSLHostConfigPreSharedKey(SSLHostConfig sslHostConfig)
Creates a new pre-shared key configuration for the given host.- Parameters:
sslHostConfig- the parent SSL host configuration
-
-
Method Detail
-
getSSLHostConfig
public SSLHostConfig getSSLHostConfig()
Returns the SSLHostConfig that owns this pre-shared key configuration.- Returns:
- the parent SSLHostConfig
-
getIdentity
public java.lang.String getIdentity()
Returns the identity associated with the pre-shared key.- Returns:
- the pre-shared key identity
-
setIdentity
public void setIdentity(java.lang.String identity)
Sets the identity associated with the pre-shared key.- Parameters:
identity- the pre-shared key identity
-
getKey
public java.lang.String getKey()
Returns the pre-shared key as a hexadecimal string.- Returns:
- the hexadecimal pre-shared key
-
setKey
public void setKey(java.lang.String key)
Sets the pre-shared key from a hexadecimal string.- Parameters:
key- the hexadecimal pre-shared key- Throws:
java.lang.IllegalArgumentException- if the key is not valid hexadecimal
-
getKeyInternal
public byte[] getKeyInternal()
Returns the pre-shared key.- Returns:
- the pre-shared key
-
getDigest
public java.lang.String getDigest()
Returns the message digest algorithm name.- Returns:
- the message digest algorithm name
-
setDigest
public void setDigest(java.lang.String digest)
Sets the message digest algorithm.- Parameters:
digest- the message digest name- Throws:
java.lang.IllegalArgumentException- if the message digest is not recognized
-
getDigestInternal
public MessageDigest getDigestInternal()
Returns the message digest.- Returns:
- the message digest
-
-