Class TlsKeyOperation


  • public final class TlsKeyOperation
    extends java.lang.Object
    A class containing a mutual TLS (mTLS) Private Key operation that needs to be performed. This class is passed to TlsKeyOperationHandler if a custom key operation is set. You MUST call either complete(output) or completeExceptionally(exception) or the TLS connection will hang forever!
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  TlsKeyOperation.Type
      The type of TlsKeyOperation that needs to be performed by the TlsKeyOperationHandler interface.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void complete​(byte[] output)
      The function to call when you have modified the input data using the private key and are ready to return it for use in the mutual TLS Handshake.
      void completeExceptionally​(java.lang.Throwable ex)
      The function to call when you either have an exception and want to complete the operation with an exception or you cannot complete the operation.
      TlsHashAlgorithm getDigestAlgorithm()
      Returns the TLS Hash algorithm used in the digest.
      byte[] getInput()
      Returns the input data from native that needs to be operated on using the private key.
      TlsSignatureAlgorithm getSignatureAlgorithm()
      Returns the TLS algorithm used in the signature.
      TlsKeyOperation.Type getType()
      Returns the operation that needs to be performed.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getInput

        public byte[] getInput()
        Returns the input data from native that needs to be operated on using the private key. You can determine the operation that needs to be performed on the data using the getType function.
        Returns:
        The input data from native that needs to be operated on
      • getType

        public TlsKeyOperation.Type getType()
        Returns the operation that needs to be performed.
        Returns:
        The operation that needs to be performed.
      • getSignatureAlgorithm

        public TlsSignatureAlgorithm getSignatureAlgorithm()
        Returns the TLS algorithm used in the signature.
        Returns:
        The TLS algorithm used in the signature
      • getDigestAlgorithm

        public TlsHashAlgorithm getDigestAlgorithm()
        Returns the TLS Hash algorithm used in the digest.
        Returns:
        The TLS Hash algorithm used in the digest
      • complete

        public void complete​(byte[] output)
        The function to call when you have modified the input data using the private key and are ready to return it for use in the mutual TLS Handshake.
        Parameters:
        output - The modified input data that has been modified by the custom key operation
      • completeExceptionally

        public void completeExceptionally​(java.lang.Throwable ex)
        The function to call when you either have an exception and want to complete the operation with an exception or you cannot complete the operation. This will mark the operation as complete with an exception so it can be reacted to accordingly.
        Parameters:
        ex - The exeception to complete with