BankDetailsEncryptor
public enum BankDetailsEncryptor : AnyEncryptor
A type that provides static methods for encrypting bank details.
-
Encrypts bank account number.
Throws
EncryptionError.encryptionFailed
if the encryption failed, maybe because the card public key is an invalid one, or for any other reason.Throws
BankDetailsEncryptor.Error.invalidAccountNumber
when trying to encrypt an empty or invalid card numberDeclaration
Swift
public static func encrypt(accountNumber: String, with publicKey: String) throws -> String
Parameters
number
The bank account number
publicKey
The public key to use for encryption (format “Exponent|Modulus”).
Return Value
An encrypted token containing card number data.
-
Encrypts bank routing number.
Throws
EncryptionError.encryptionFailed
if the encryption failed, maybe because the card public key is an invalid one, or for any other reason.Throws
BankDetailsEncryptor.Error.invalidRoutingNumber
when trying to encrypt an empty or invalid card numberDeclaration
Swift
public static func encrypt(routingNumber: String, with publicKey: String) throws -> String
Parameters
number
The bank account number
publicKey
The public key to use for encryption (format “Exponent|Modulus”).
Return Value
An encrypted token containing card number data.
-
Describes the errors that can occur during bank details encryption.
See moreDeclaration
Swift
public enum Error : LocalizedError