CryptoError
public enum CryptoError : Error
extension CryptoError: LocalizedError
extension CryptoError: CustomNSError
Error subtypes of the LINE SDK, which are related to certificates, keys, and token verification.
A CryptoError
will not be thrown to you directly. This type of error will be wrapped under
LineSDKError.authorizeFailed
with the .cryptoError
reason and the error code 3016
. Find the
underlying CryptoError
by checking the associated value of the .cryptoError
reason or the
.underlyingError
key in the error’s userInfo
.
You can switch over to each error to find out the reason of the error and its associated information. You can also
access the localizedDescription
property to get a human-readable text description. Access errorCode
to get a fixed error code to identify the error type quickly. All CryptoError
s are under the
“LineSDKError.CryptoError” error domain.
- algorithmsFailed: An error occurred while performing an algorithm-related operation like creating keys or verifying signed data.
- JWTFailed: An error occurred while performing a JWT-related operation.
- JWKFailed: An error occurred while performing a JWK-related operation.
- generalError: An error occurred while performing another cryptography-related operation.
-
The possible underlying reasons an
.algorithmsFailed
error occurs.- invalidDERKey: The DER data does not contain a valid RSA key. Code 3016_1001.
- invalidX509Header: The x509 header is found in the key, but the data is invalid. Code 3016_1002.
- createKeyFailed: An error occurred while creating a security key. Code 3016_1003.
- invalidPEMKey: The PEM key is invalid. Code 3016_1004.
- encryptingError: An error occurred while encrypting plain data. Code 3016_1005.
- decryptingError: An error occurred while decrypting encrypted data. Code 3016_1006.
- signingError: An error occurred while signing plain data. Code 3016_1007.
- verifyingError: An error occurred while verifying data. Code 3016_1008.
- invalidSignature: The algorithm does not accept the input data as a signature. The data is corrupted. Code 3016_1009.
Declaration
Swift
public enum AlgorithmsErrorReason
-
The possible underlying reasons a
.JWTFailed
error occurs.- malformedJWTFormat: The input text is not a valid JWT encoded string. Code 3016_2001.
- unsupportedHeaderAlgorithm: The algorithm defined in the JWT header is not supported in the LINE SDK. Code 3016_2002.
- claimVerifyingFailed: Verification for a certain key in the JWT payload does not pass. Code 3016_2003.
Declaration
Swift
public enum JWTErrorReason
-
The possible underlying reasons an
.JWKFailed
error occurs.- unsupportedKeyType: The key type is not supported in the LINE SDK. Code 3016_3001.
Declaration
Swift
public enum JWKErrorReason
-
The possible underlying reasons a
.generalError
occurs.- base64ConversionFailed: The string cannot be converted to the base64 data format. Code 3016_4001.
- dataConversionFailed: The data cannot be converted to a string with the given encoding. Code 3016_4002.
- stringConversionFailed: The string cannot be converted to data with the given encoding. Code 3016_4003.
- operationNotSupported: The operation is not supported by the current OS. Code 3016_4004.
- decodingFailed: The data cannot be decoded to the target type. Code 3016_4005.
Declaration
Swift
public enum GeneralErrorReason
-
An error occurred while performing an algorithm-related operation like creating keys or verifying signed data.
Declaration
Swift
case algorithmsFailed(reason: AlgorithmsErrorReason)
-
An error occurred while performing a JWT-related operation.
Declaration
Swift
case JWTFailed(reason: JWTErrorReason)
-
An error occurred while performing a JWK-related operation.
Declaration
Swift
case JWKFailed(reason: JWKErrorReason)
-
An error occurred while performing another cryptography-related operation.
Declaration
Swift
case generalError(reason: GeneralErrorReason)
-
Describes the cause of an error in human-readable text.
Declaration
Swift
public var errorDescription: String? { get }