瀏覽代碼

Removed default implementations

Brandon Toms 2 年之前
父節點
當前提交
e577605744
共有 1 個文件被更改,包括 0 次插入23 次删除
  1. 0 23
      Sources/CryptoSwift/PEM/DER.swift

+ 0 - 23
Sources/CryptoSwift/PEM/DER.swift

@@ -37,15 +37,6 @@ internal protocol DERDecodable {
   init(rawRepresentation: Data) throws
 }
 
-extension DERDecodable {
-  public init(rawRepresentation raw: Data) throws {
-    /// The default implementation that makes the original internal initializer publicly available
-    do { try self.init(privateDER: raw.bytes) } catch {
-      try self.init(publicDER: raw.bytes)
-    }
-  }
-}
-
 /// Conform to this protocol if your type can be described in an ASN1 DER representation
 internal protocol DEREncodable {
   /// Returns the DER encoded representation of the Public Key
@@ -64,20 +55,6 @@ internal protocol DEREncodable {
   func publicKeyExternalRepresentation() throws -> Data
 }
 
-extension DEREncodable {
-  public func externalRepresentation() throws -> Data {
-    // The default implementation that makes the original internal function publicly available
-    do { return try Data(self.privateKeyDER()) } catch {
-      return try Data(self.publicKeyDER())
-    }
-  }
-
-  public func publicKeyExternalRepresentation() throws -> Data {
-    // The default implementation that makes the original internal function publicly available
-    try Data(self.publicKeyDER())
-  }
-}
-
 struct DER {
   internal enum Error: Swift.Error {
     /// We were provided invalid DER data