Class ProviderContext.Context

java.lang.Object
org.jose4j.jca.ProviderContext.Context
Enclosing class:
ProviderContext

public class ProviderContext.Context extends Object
Allows for a provider to be named for various operations. Not all operations are relevant in any particular JOSE context.
  • Constructor Details

    • Context

      public Context()
  • Method Details

    • getGeneralProvider

      public String getGeneralProvider()
      Gets the general JCA provider to be used for all relevant operations when a more specific one isn't set.
      Returns:
      the general JCA provider name
    • setGeneralProvider

      public void setGeneralProvider(String generalProvider)
      Sets the general JCA provider to be used for all relevant operations when a more specific one isn't set. null to use the system configured providers.
      Parameters:
      generalProvider - the provider name
    • getKeyPairGeneratorProvider

      public String getKeyPairGeneratorProvider()
      Gets the JCA provider to be used for relevant KeyPairGenerator operations.
      Returns:
      the name of the provider or null for the system configured providers.
    • setKeyPairGeneratorProvider

      public void setKeyPairGeneratorProvider(String keyPairGeneratorProvider)
      Sets the JCA provider to be used for relevant KeyPairGenerator operations. null to use the system configured providers.
      Parameters:
      keyPairGeneratorProvider - the provider name
    • getKeyAgreementProvider

      public String getKeyAgreementProvider()
      Gets the JCA provider to be used for relevant KeyAgreement operations.
      Returns:
      the name of the provider or null for the system configured providers.
    • setKeyAgreementProvider

      public void setKeyAgreementProvider(String keyAgreementProvider)
      Sets the JCA provider to be used for relevant KeyAgreement operations. null to use the system configured providers.
      Parameters:
      keyAgreementProvider - the provider name
    • getCipherProvider

      public String getCipherProvider()
      Gets the JCA provider to be used for relevant Cipher operations.
      Returns:
      the name of the provider or null for the system configured providers.
    • setCipherProvider

      public void setCipherProvider(String cipherProvider)
      Sets the JCA provider to be used for relevant Cipher operations. null to use the system configured providers.
      Parameters:
      cipherProvider - the provider name
    • getKeyDecipherModeOverride

      public ProviderContext.KeyDecipherMode getKeyDecipherModeOverride()
      Gets the cipher mode to use when deciphering/decrypting/unwrapping an encrypted content encryption key.
      Returns:
      the mode
      Since:
      0.9.1
    • setKeyDecipherModeOverride

      public void setKeyDecipherModeOverride(ProviderContext.KeyDecipherMode keyDecipherModeOverride)
      Sets the cipher mode to use when deciphering/decrypting/unwrapping an encrypted content encryption key. Using decrypt mode with certain JCA providers might be necessary for access to the raw bytes of the decrypted key, which are needed when decrypting the JWE Ciphertext.
      Parameters:
      keyDecipherModeOverride - the mode
      Since:
      0.9.1
    • getSignatureProvider

      public String getSignatureProvider()
      Gets the JCA provider to be used for relevant Signature operations.
      Returns:
      the name of the provider or null for the system configured providers.
    • setSignatureProvider

      public void setSignatureProvider(String signatureProvider)
      Sets the JCA provider to be used for relevant Signature operations. null to use the system configured providers.
      Parameters:
      signatureProvider - the provider name
    • getSignatureAlgorithmOverride

      public ProviderContext.SignatureAlgorithmOverride getSignatureAlgorithmOverride()
      Gets the algorithm info (name and parameter spec) to be used as overrides for relevant Signature operations. Null means no override is done and the normal algorithm details are used.
      Returns:
      the SignatureAlgorithmOverride object or null
    • setSignatureAlgorithmOverride

      public void setSignatureAlgorithmOverride(ProviderContext.SignatureAlgorithmOverride signatureAlgorithmOverride)
      Sets the algorithm info (name and parameter spec) to be used as overrides for relevant Signature operations. The need for this should be quite rare but it could be useful in cases where different providers are using different names for the same algorithm - and there have been some naming inconsistencies with RSAPSS where RSASSA-PSS + AlgorithmParameterSpec was used when PSS support was added to the default JRE but providers that supported PSS earlier used something like SHA256withRSAandMGF1).
      Parameters:
      signatureAlgorithmOverride - with the algorithm info. Null indicates to use the defaults (and is the default in and of itself).
    • getMacProvider

      public String getMacProvider()
      Gets the JCA provider to be used for relevant Mac operations.
      Returns:
      of the Mac provider or null for the system configured providers.
    • setMacProvider

      public void setMacProvider(String macProvider)
      Sets the JCA provider to be used for relevant Mac operations. null to use the system configured providers.
      Parameters:
      macProvider - the provider name
    • getMessageDigestProvider

      public String getMessageDigestProvider()
      Gets the JCA provider to be used for relevant MessageDigest operations.
      Returns:
      the name of the provider or null for the system configured providers.
    • setMessageDigestProvider

      public void setMessageDigestProvider(String messageDigestProvider)
      Sets the JCA provider to be used for relevant MessageDigest operations. null to use the system configured providers.
      Parameters:
      messageDigestProvider - the provider name
    • getKeyFactoryProvider

      public String getKeyFactoryProvider()
      Gets the JCA provider to be used for relevant KeyFactory operations.
      Returns:
      the name of the provider or null for the system configured providers.
    • setKeyFactoryProvider

      public void setKeyFactoryProvider(String keyFactoryProvider)
      Sets the JCA provider to be used for relevant KeyFactory operations. null to use the system configured providers.
      Parameters:
      keyFactoryProvider - the provider name