Class AbstractTlsSecret

  • All Implemented Interfaces:
    TlsSecret
    Direct Known Subclasses:
    BcTlsSecret, JceTlsSecret

    public abstract class AbstractTlsSecret
    extends java.lang.Object
    implements TlsSecret
    Base class for a TlsSecret implementation which captures common code and fields.
    • Field Detail

      • data

        protected byte[] data
    • Constructor Detail

      • AbstractTlsSecret

        protected AbstractTlsSecret​(byte[] data)
        Base constructor.
        Parameters:
        data - the byte[] making up the secret value.
    • Method Detail

      • checkAlive

        protected void checkAlive()
      • destroy

        public void destroy()
        Description copied from interface: TlsSecret
        Destroy the internal state of the secret. After this call, any attempt to use the TlsSecret will result in an IllegalStateException being thrown.
        Specified by:
        destroy in interface TlsSecret
      • encrypt

        public byte[] encrypt​(TlsCertificate certificate)
                       throws java.io.IOException
        Description copied from interface: TlsSecret
        Return an encrypted copy of the data this secret is based on.
        Specified by:
        encrypt in interface TlsSecret
        Parameters:
        certificate - the certificate containing the public key to use for protecting the internal data.
        Returns:
        an encrypted copy of this secret's internal data.
        Throws:
        java.io.IOException
      • extract

        public byte[] extract()
        Description copied from interface: TlsSecret
        Return the internal data from this secret. The TlsSecret does not keep a copy of the data. After this call, any attempt to use the TlsSecret will result in an IllegalStateException being thrown.
        Specified by:
        extract in interface TlsSecret
        Returns:
        the secret's internal data.
      • isAlive

        public boolean isAlive()
        Specified by:
        isAlive in interface TlsSecret