浏览代码

Marked externalRepresentation as public and added the publicKeyExternalRepresentation function

Brandon Toms 2 年之前
父节点
当前提交
713f0e0ec5
共有 1 个文件被更改,包括 5 次插入1 次删除
  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
   /// /// You now have a CryptoSwift RSA Key
   /// ```
   /// ```
   ///
   ///
-  func externalRepresentation() throws -> Data {
+  public func externalRepresentation() throws -> Data {
     if self.primes != nil {
     if self.primes != nil {
       return try Data(self.privateKeyDER())
       return try Data(self.privateKeyDER())
     } else {
     } else {
       return try Data(self.publicKeyDER())
       return try Data(self.publicKeyDER())
     }
     }
   }
   }
+
+  public func publicKeyExternalRepresentation() throws -> Data {
+    return try Data(self.publicKeyDER())
+  }
 }
 }
 
 
 // MARK: CS.BigUInt extension
 // MARK: CS.BigUInt extension