                             algorithm: signatureAlgorithm,
                             certChain: certChainData.map { $0.base64EncodedString() }
                         )
-
-                        // Key for signing
-                        let privateKeyPEM = try Data(contentsOf: certPrivateKeyPath)
 
                         let privateKey: PrivateKey
                         switch keyType {


    public func sign(collection: Model.Collection,
                     certChainPaths: [URL],
                     certPrivateKeyPath: URL,
                     certPolicyKey: CertificatePolicyKey = .default,
                     callback: @escaping (Result<Model.SignedCollection, Error>) -> Void) {
        do {

import TSCBasic

public protocol PackageCollectionSigner {
    /// Signs package collection using the given certificate and key.
    ///
    /// - Parameters:
    ///   - collection: The package collection to be signed
    ///   - certChainPaths: Paths to all DER-encoded certificates in the chain. The certificate used for signing
    ///                     must be the first in the array.
    ///   - privateKeyPEM: Data of the private key (*.pem) of the certificate
    ///   - certPolicyKey: The key of the `CertificatePolicy` to use for validating certificates
    ///   - callback: The callback to invoke when the signed collection is available.
    func sign(collection: PackageCollectionModel.V1.Collection,
              certChainPaths: [URL],
              privateKeyPEM: Data,
              certPolicyKey: CertificatePolicyKey,
              callback: @escaping (Result<PackageCollectionModel.V1.SignedCollection, Error>) -> Void)
}

extension PackageCollectionSigner {
    /// Signs package collection using the given certificate and key.
    ///
    /// - Parameters:
