Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prepare Scala 3, sbt 2 build #205

Merged
merged 1 commit into from
Oct 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -140,5 +140,5 @@ class PublicKey(val nested: PGPPublicKey) extends PublicKeyLike with StreamingSa
}
object PublicKey {
def apply(nested: PGPPublicKey) = new PublicKey(nested)
implicit def unwrap(key: PublicKey) = key.nested
implicit def unwrap(key: PublicKey): PGPPublicKey = key.nested
}
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class PublicKeyRingCollection(val nested: PGPPublicKeyRingCollection) extends Pu
override def toString = "PublicKeyRingCollecton(\n\t%s\n)" format (keyRings mkString ",\n\t")
}
object PublicKeyRingCollection extends StreamingLoadable[PublicKeyRingCollection] {
implicit def unwrap(ring: PublicKeyRingCollection) = ring.nested
implicit def unwrap(ring: PublicKeyRingCollection): PGPPublicKeyRingCollection = ring.nested
def apply(nested: PGPPublicKeyRingCollection) = new PublicKeyRingCollection(nested)
def load(input: InputStream) =
apply(new PGPPublicKeyRingCollection(PGPUtil.getDecoderStream(input), new BcKeyFingerprintCalculator))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class SecretKeyRing(val nested: PGPSecretKeyRing) extends StreamingSaveable {
}

object SecretKeyRing extends StreamingLoadable[SecretKeyRing] {
implicit def unwrap(ring: SecretKeyRing) = ring.nested
implicit def unwrap(ring: SecretKeyRing): PGPSecretKeyRing = ring.nested
def apply(ring: PGPSecretKeyRing) = new SecretKeyRing(ring)
// TODO - Another way of generating SecretKeyRing from SecretKey objects.
def load(input: InputStream) =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class SecretKeyRingCollection(val nested: PGPSecretKeyRingCollection) extends St
}

object SecretKeyRingCollection extends StreamingLoadable[SecretKeyRingCollection] {
implicit def unwrap(ring: SecretKeyRingCollection) = ring.nested
implicit def unwrap(ring: SecretKeyRingCollection): PGPSecretKeyRingCollection = ring.nested
def apply(nested: PGPSecretKeyRingCollection) = new SecretKeyRingCollection(nested)
def load(input: InputStream) =
apply(new PGPSecretKeyRingCollection(PGPUtil.getDecoderStream(input), new BcKeyFingerprintCalculator))
Expand Down
6 changes: 3 additions & 3 deletions gpg-library/src/main/scala/com/jsuereth/pgp/hkp/client.scala
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,20 @@ private[hkp] class GigahorseClient(serverUrl: String) extends Client {

/** Pushes a key to the given public key server. */
def pushKey(key: PublicKey, logger: String => Unit): Unit =
http.run(initiateFormPost(AddKey(key)), Gigahorse.asString andThen { c: String =>
http.run(initiateFormPost(AddKey(key)), Gigahorse.asString andThen { (c: String) =>
logger("received: " + c)
})

/** Pushes a key to the given public key server. */
def pushKeyRing(key: PublicKeyRing, logger: String => Unit): Unit =
http.run(initiateFormPost(AddKey(key)), Gigahorse.asString andThen { c: String =>
http.run(initiateFormPost(AddKey(key)), Gigahorse.asString andThen { (c: String) =>
logger("received: " + c)
})

/** Searches for a term on the keyserver and returns all the results. */
def search(term: String): Future[Vector[LookupKeyResult]] =
http
.run(initiateRequest(Find(term)), Gigahorse.asString andThen { s: String =>
.run(initiateRequest(Find(term)), Gigahorse.asString andThen { (s: String) =>
Client.LookupParser.parse(s)
})
.recover {
Expand Down
Loading