Explorar o código

Marked externalRepresentation as public and added the publicKeyExternalRepresentation function

Brandon Toms %!s(int64=2) %!d(string=hai) anos
pai
achega
713f0e0ec5
Modificáronse 1 ficheiros con 5 adicións e 1 borrados
  1. 5 1
      Sources/CryptoSwift/RSA/RSA.swift

+ 5 - 1
Sources/CryptoSwift/RSA/RSA.swift

@@ -381,13 +381,17 @@ extension RSA {
   /// /// You now have a CryptoSwift RSA Key
   /// ```
   ///
-  func externalRepresentation() throws -> Data {
+  public func externalRepresentation() throws -> Data {
     if self.primes != nil {
       return try Data(self.privateKeyDER())
     } else {
       return try Data(self.publicKeyDER())
     }
   }
+
+  public func publicKeyExternalRepresentation() throws -> Data {
+    return try Data(self.publicKeyDER())
+  }
 }
 
 // MARK: CS.BigUInt extension