Class OperatorCreationException
java.lang.Object
java.lang.Throwable
java.lang.Exception
org.bouncycastle.operator.OperatorException
org.bouncycastle.operator.OperatorCreationException
- All Implemented Interfaces:
Serializable
Thrown by an operator builder when it cannot produce the requested operator.
Operator builders — for example JcaContentSignerBuilder,
BcRSAContentSignerBuilder, JcaDigestCalculatorProviderBuilder,
JceCMSContentEncryptorBuilder — assemble a configured operator
(ContentSigner, DigestCalculator, etc.) from caller-supplied inputs:
an algorithm identifier or name, a key, a SecureRandom, optional JCA provider,
and so on. Construction can fail before any data has been processed, for reasons such as:
- unknown or unsupported algorithm OID / name;
- key type incompatible with the requested algorithm (e.g. an RSA key passed to an EC signer);
- invalid or unsupported parameter combination (key size, hash, PSS salt length, etc.);
- the underlying JCA provider is missing, misconfigured, or rejects the algorithm
(manifests as a
NoSuchAlgorithmException/NoSuchProviderException/InvalidKeyExceptionon the cause chain); - a lightweight engine could not be initialised (manifests as a
CryptoExceptionon the cause chain).
Throwable.getCause() for the underlying exception when one is supplied.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionConstruct an exception with the supplied diagnostic message and no underlying cause.OperatorCreationException(String msg, Throwable cause) Construct an exception with the supplied diagnostic message and the underlying cause (typically aGeneralSecurityExceptionsubclass or a lightweightorg.bouncycastle.crypto.CryptoException) returned by the JCA or lightweight machinery the builder was driving. -
Method Summary
Methods inherited from class Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
OperatorCreationException
Construct an exception with the supplied diagnostic message and the underlying cause (typically aGeneralSecurityExceptionsubclass or a lightweightorg.bouncycastle.crypto.CryptoException) returned by the JCA or lightweight machinery the builder was driving.- Parameters:
msg- diagnostic message describing what the builder was trying to do and why it failed.cause- the underlying exception that triggered the failure, ornull.
-
OperatorCreationException
Construct an exception with the supplied diagnostic message and no underlying cause.- Parameters:
msg- diagnostic message describing what the builder was trying to do and why it failed.
-