|
@@ -17,6 +17,15 @@ import Foundation
|
|
|
|
|
|
extension AES {
|
|
|
/// Initialize with CBC block mode.
|
|
|
+ ///
|
|
|
+ /// - Parameters:
|
|
|
+ /// - key: Key as a String.
|
|
|
+ /// - iv: IV as a String.
|
|
|
+ /// - padding: Padding
|
|
|
+ /// - Throws: Error
|
|
|
+ ///
|
|
|
+ /// The input is a String, that is treat as sequence of bytes made directly out of String.
|
|
|
+ /// If input is Base64 encoded data (which is a String technically) it is not decoded automatically for you.
|
|
|
public convenience init(key: String, iv: String, padding: Padding = .pkcs7) throws {
|
|
|
try self.init(key: key.bytes, blockMode: CBC(iv: iv.bytes), padding: padding)
|
|
|
}
|