Interface Credential


public interface Credential
A Credential is effectively a wrapper around a PrivateKey
  • Method Details

    • getName

      String getName(Principal principal, String userid)
      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 principal
      userid - the "userid" that this anonymous principal specified when listing keys
      Returns:
      a credential id or null
    • matches

      boolean matches(Principal principal, String cid)
      Return true if this principal has access to the specified credential id
      Parameters:
      principal - the principal
      cid - the credential id
      Returns:
      true if the credential can be accessed by this principal under that name, false otherwise
    • getPrivateKey

      PrivateKey getPrivateKey(String password)
      Return the Private Key. Only called after the Credential has been verified by the matches() 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 custom KeyAuthorization
      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 custom KeyAuthorization
      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 custom KeyAuthorization
      Returns:
      the KeyStore alias