Ver código fonte

Marked externalRepresentation as public and added the publicKeyExternalRepresentation function

Brandon Toms 2 anos atrás
pai
commit
713f0e0ec5
1 arquivos alterados com 5 adições e 1 exclusões
  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