Package com.bfo.netkeystore.server
Interface Credential
public interface Credential
A Credential is effectively a wrapper around a PrivateKey
-
Method Summary
Modifier and TypeMethodDescriptionReturn a read-only certificates for this CredentialgetInfo()
Return the info map for this key that should be returned in credentials/infoReturn the KeyStore this Credential comes from.Return the name of the KeyStore this Credential comes from.Return the name of the KeyStore this Credential comes from.Return the name this Credential is known by for the specified Principal, or null if the Principal has no access to this keygetPrivateKey
(String password) Return the Private Key.boolean
Return true if this principal has access to the specified credential id
-
Method Details
-
getName
Return the name this Credential is known by for the specified Principal, or null if the Principal has no access to this key- Parameters:
principal
- the principaluserid
- the "userid" that this anonymous principal specified when listing keys- Returns:
- a credential id or null
-
matches
Return true if this principal has access to the specified credential id- Parameters:
principal
- the principalcid
- the credential id- Returns:
- true if the credential can be accessed by this principal under that name, false otherwise
-
getPrivateKey
Return the Private Key. Only called after the Credential has been verified by thematches()
method, the specified password may be used, ignored or altered depending on the values of local_password and share_password when the Credential was created.- Parameters:
password
- the password supplied by the client- Returns:
- the key or null if access is denied
-
getCertificates
List<X509Certificate> getCertificates()Return a read-only certificates for this Credential- Returns:
- the list of certificates
-
getInfo
Json getInfo()Return the info map for this key that should be returned in credentials/info- Returns:
- the info
-
getKeyStore
KeyStore getKeyStore()Return the KeyStore this Credential comes from. Not required by the API, it may be useful to a customKeyAuthorization
- Returns:
- the KeyStore
-
getKeyStoreName
String getKeyStoreName()Return the name of the KeyStore this Credential comes from. Not required by the API, it may be useful to a customKeyAuthorization
- Returns:
- the KeyStore name
-
getKeyStoreAlias
String getKeyStoreAlias()Return the name of the KeyStore this Credential comes from. Not required by the API, it may be useful to a customKeyAuthorization
- Returns:
- the KeyStore alias
-