Skip to content

Commit

Permalink
Marked externalRepresentation as public and added the publicKeyExtern…
Browse files Browse the repository at this point in the history
…alRepresentation function
  • Loading branch information
btoms20 committed Sep 17, 2022
1 parent 306be21 commit 713f0e0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Sources/CryptoSwift/RSA/RSA.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 713f0e0

Please sign in to comment.