Class CryptoPrimitive

java.lang.Object
org.jose4j.jwa.CryptoPrimitive

public class CryptoPrimitive extends Object
A wrapper class for a crypto primitive object, such as Signature and Mac, which helps them transcend abstraction layers to be accessed in places they arguably should't be.
  • Constructor Details

    • CryptoPrimitive

      public CryptoPrimitive(Signature sig)
    • CryptoPrimitive

      public CryptoPrimitive(Cipher cipher)
    • CryptoPrimitive

      public CryptoPrimitive(Mac mac)
    • CryptoPrimitive

      public CryptoPrimitive(Key key)
    • CryptoPrimitive

      public CryptoPrimitive(KeyAgreement keyAgreement)
  • Method Details

    • getSignature

      public Signature getSignature()
      Get the Signature object.
      Returns:
      Signature object or null if this wrapper doesn't have one.
    • getCipher

      public Cipher getCipher()
      Get the Cipher object.
      Returns:
      Cipher object or null if this wrapper doesn't have one.
    • getMac

      public Mac getMac()
      Get the Mac object.
      Returns:
      Mac object or null if this wrapper doesn't have one.
    • getKey

      public Key getKey()
      Get the Key object.
      Returns:
      Key object or null if this wrapper doesn't have one.
    • getKeyAgreement

      public KeyAgreement getKeyAgreement()
      Get the KeyAgreement object.
      Returns:
      KeyAgreement object or null if this wrapper doesn't have one.