Package anbxj

Class AnBx_Agent

java.lang.Object
anbxj.AnBx_Agent
All Implemented Interfaces:
Serializable, Principal

public class AnBx_Agent extends Object implements Principal, Serializable
AnBx Agent
See Also:
  • Constructor Details

    • AnBx_Agent

      public AnBx_Agent(String alias)
      Constructs an AnBx_Agent with the specified alias (no certificates).
      Parameters:
      alias - The alias for the AnBx_Agent.
    • AnBx_Agent

      public AnBx_Agent(String alias, Map<Crypto_KeyStoreType,Certificate> cert)
      Constructs an AnBx_Agent with the specified alias and certificates.
      Parameters:
      alias - The alias for the AnBx_Agent.
      cert - The certificates associated with the AnBx_Agent.
    • AnBx_Agent

      public AnBx_Agent(String alias, AnB_Crypto_Wrapper lb)
      Constructs an AnBx_Agent with the specified alias and certificates retrieved from a Crypto_Wrapper (works for both AnB_Crypto_Wrapper and AnB_Session because AnB_Session extends AnB_Crypto_Wrapper).
      Parameters:
      alias - The alias for the AnBx_Agent.
      lb - The Crypto_Wrapper from which to retrieve certificates.
  • Method Details

    • isCertified

      public boolean isCertified()
      Checks if the AnBx_Agent has certificates for all specified Crypto_KeyStoreTypes.
      Returns:
      true if all certificate slots are non-null, false otherwise.
    • equals

      public boolean equals(Object obj)
      Specified by:
      equals in interface Principal
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in interface Principal
      Overrides:
      hashCode in class Object
    • getCert

      public Certificate getCert(Crypto_KeyStoreType kst)
      Retrieves the certificate associated with the specified Crypto_KeyStoreType.

      If the agent has no certificate map (i.e. it was constructed without certificates) or if simply no certificate is stored for the requested keystore type, this method returns null.

      Parameters:
      kst - the keystore type for which to get the certificate; must not be null
      Returns:
      the certificate for the given keystore type, or null if none is available
      Throws:
      NullPointerException - if kst is null
    • getName

      public String getName()
      Specified by:
      getName in interface Principal
    • toString

      public String toString()
      Specified by:
      toString in interface Principal
      Overrides:
      toString in class Object