File tree Expand file tree Collapse file tree 3 files changed +15
-4
lines changed Expand file tree Collapse file tree 3 files changed +15
-4
lines changed Original file line number Diff line number Diff line change
1
+ {
2
+ "autoPin": true,
3
+ "pins": [
4
+ {
5
+ "package": "CryptoSwift",
6
+ "reason": null,
7
+ "repositoryURL": "https://github.com/krzyzanowskim/CryptoSwift",
8
+ "version": "0.6.9"
9
+ }
10
+ ],
11
+ "version": 1
12
+ }
Original file line number Diff line number Diff line change @@ -59,8 +59,7 @@ public enum Algorithm: CustomStringConvertible {
59
59
60
60
func signRS( _ key: Data , digestType: Signature . DigestType ) throws -> String {
61
61
62
- let keyString = message. data ( using: String . Encoding. utf8, allowLossyConversion: false ) !
63
- let privateKey = try PrivateKey ( pemEncoded: keyString)
62
+ let privateKey = try PrivateKey ( data: data)
64
63
65
64
let clear = try ClearMessage ( string: message, using: . utf8)
66
65
@@ -85,10 +84,10 @@ public enum Algorithm: CustomStringConvertible {
85
84
return signHS ( key, variant: . sha512)
86
85
87
86
case . rs256( let key) :
88
- return try signRS ( privateKey , digestType: . sha256)
87
+ return try signRS ( key , digestType: . sha256)
89
88
90
89
case . rs512( let key) :
91
- return try signRS ( privateKey , digestType: . sha512)
90
+ return try signRS ( key , digestType: . sha512)
92
91
93
92
}
94
93
}
You can’t perform that action at this time.
0 commit comments