Package com.symphony.api.id
Class SingleSymphonyIdentity
- java.lang.Object
-
- com.symphony.api.id.SingleSymphonyIdentity
-
- All Implemented Interfaces:
SymphonyIdentity
- Direct Known Subclasses:
P12SymphonyIdentity
,PemSymphonyIdentity
public class SingleSymphonyIdentity extends Object implements SymphonyIdentity
Holds a single symphony identity, using a singleKeyManager
.- Author:
- Rob Moffat
-
-
Field Summary
Fields Modifier and Type Field Description protected X509Certificate[]
chain
protected String
commonName
protected String
email
protected RSAPrivateCrtKey
privateKey
-
Constructor Summary
Constructors Constructor Description SingleSymphonyIdentity()
SingleSymphonyIdentity(RSAPrivateCrtKey privateKey, String email, X509Certificate[] chain, String commonName)
SingleSymphonyIdentity(X509KeyManager km, String email, String alias)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description X509Certificate[]
getCertificateChain()
Utility method for inspecting the certificate chain that this user will present when logging in.String
getCommonName()
Common name extracted from the first certificate in the chain, or provided as a string.static String
getCommonName(X509Certificate[] chain)
String
getEmail()
Email of the user.KeyManager[]
getKeyManagers()
Use this method when setting up a Symphony client in order to authenticate using the certificates and private key contained in this object.PrivateKey
getPrivateKey()
PublicKey
getPublicKey()
-
-
-
Field Detail
-
privateKey
protected RSAPrivateCrtKey privateKey
-
email
protected String email
-
commonName
protected String commonName
-
chain
protected X509Certificate[] chain
-
-
Constructor Detail
-
SingleSymphonyIdentity
public SingleSymphonyIdentity()
-
SingleSymphonyIdentity
public SingleSymphonyIdentity(RSAPrivateCrtKey privateKey, String email, X509Certificate[] chain, String commonName)
-
SingleSymphonyIdentity
public SingleSymphonyIdentity(X509KeyManager km, String email, String alias)
-
-
Method Detail
-
getPrivateKey
public PrivateKey getPrivateKey()
- Specified by:
getPrivateKey
in interfaceSymphonyIdentity
-
getPublicKey
public PublicKey getPublicKey() throws Exception
- Specified by:
getPublicKey
in interfaceSymphonyIdentity
- Throws:
Exception
-
getEmail
public String getEmail()
Description copied from interface:SymphonyIdentity
Email of the user. This is held in configuration, rather than looking it up in Symphony. Bots generally have email addresses, even if they don't read them.- Specified by:
getEmail
in interfaceSymphonyIdentity
-
getKeyManagers
public KeyManager[] getKeyManagers()
Description copied from interface:SymphonyIdentity
Use this method when setting up a Symphony client in order to authenticate using the certificates and private key contained in this object.- Specified by:
getKeyManagers
in interfaceSymphonyIdentity
-
getCertificateChain
public X509Certificate[] getCertificateChain()
Description copied from interface:SymphonyIdentity
Utility method for inspecting the certificate chain that this user will present when logging in. This will be an empty array if the user uses Private Key login.- Specified by:
getCertificateChain
in interfaceSymphonyIdentity
-
getCommonName
public String getCommonName()
Description copied from interface:SymphonyIdentity
Common name extracted from the first certificate in the chain, or provided as a string.- Specified by:
getCommonName
in interfaceSymphonyIdentity
-
getCommonName
public static String getCommonName(X509Certificate[] chain)
-
-