File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed
cryptography-providers/cryptokit/src/commonMain Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -86,7 +86,7 @@ private class EcdsaPublicKey(
86
86
override fun encodeToByteArrayBlocking (format : EC .PublicKey .Format ): ByteArray = when (format) {
87
87
EC .PublicKey .Format .DER -> publicKey.derRepresentation().toByteArray()
88
88
EC .PublicKey .Format .JWK -> error(" JWK is not supported" )
89
- EC .PublicKey .Format .PEM -> publicKey.pemRepresentation().encodeToByteArray()
89
+ EC .PublicKey .Format .PEM -> ( publicKey.pemRepresentation() + " \n " ).encodeToByteArray()
90
90
EC .PublicKey .Format .RAW -> publicKey.rawRepresentation().toByteArray()
91
91
}
92
92
@@ -108,7 +108,7 @@ private class EcdsaPrivateKey(
108
108
EC .PrivateKey .Format .DER -> privateKey.derRepresentation().toByteArray()
109
109
EC .PrivateKey .Format .DER .SEC1 -> TODO ()
110
110
EC .PrivateKey .Format .JWK -> error(" JWK is not supported" )
111
- EC .PrivateKey .Format .PEM -> privateKey.pemRepresentation().encodeToByteArray()
111
+ EC .PrivateKey .Format .PEM -> ( privateKey.pemRepresentation() + " \n " ).encodeToByteArray()
112
112
EC .PrivateKey .Format .PEM .SEC1 -> TODO ()
113
113
EC .PrivateKey .Format .RAW -> privateKey.rawRepresentation().toByteArray()
114
114
}
Original file line number Diff line number Diff line change @@ -23,15 +23,15 @@ import Foundation
23
23
switch curve {
24
24
case . p256:
25
25
return SwiftEcdsaPublicKey (
26
- key: try P256 . Signing. PublicKey ( rawRepresentation : rawRepresentation as Data ) ,
26
+ key: try P256 . Signing. PublicKey ( x963Representation : rawRepresentation as Data ) ,
27
27
curve: . p256)
28
28
case . p384:
29
29
return SwiftEcdsaPublicKey (
30
- key: try P384 . Signing. PublicKey ( rawRepresentation : rawRepresentation as Data ) ,
30
+ key: try P384 . Signing. PublicKey ( x963Representation : rawRepresentation as Data ) ,
31
31
curve: . p384)
32
32
case . p521:
33
33
return SwiftEcdsaPublicKey (
34
- key: try P521 . Signing. PublicKey ( rawRepresentation : rawRepresentation as Data ) ,
34
+ key: try P521 . Signing. PublicKey ( x963Representation : rawRepresentation as Data ) ,
35
35
curve: . p521)
36
36
}
37
37
}
@@ -122,9 +122,9 @@ import Foundation
122
122
123
123
@objc public func rawRepresentation( ) -> Data {
124
124
switch curve {
125
- case . p256: return ( key as! P256 . Signing. PublicKey) . rawRepresentation
126
- case . p384: return ( key as! P384 . Signing. PublicKey) . rawRepresentation
127
- case . p521: return ( key as! P521 . Signing. PublicKey) . rawRepresentation
125
+ case . p256: return ( key as! P256 . Signing. PublicKey) . x963Representation
126
+ case . p384: return ( key as! P384 . Signing. PublicKey) . x963Representation
127
+ case . p521: return ( key as! P521 . Signing. PublicKey) . x963Representation
128
128
}
129
129
}
130
130
You can’t perform that action at this time.
0 commit comments