PublicKey

com.jsuereth.pgp.PublicKey
See thePublicKey companion object
class PublicKey(val nested: PGPPublicKey) extends PublicKeyLike, StreamingSaveable

This class represents a public PGP key. It can be used to encrypt messages for a person and validate that messages were signed correctly.

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Type members

Classlikes

object signatures extends Iterable[Signature]

Attributes

Supertypes
trait Iterable[Signature]
trait IterableFactoryDefaults[Signature, Iterable]
trait IterableOps[Signature, Iterable, Iterable[Signature]]
trait IterableOnceOps[Signature, Iterable, Iterable[Signature]]
trait IterableOnce[Signature]
class Object
trait Matchable
class Any
Show all
Self type
signatures.type
object userIDs extends Iterable[String]

Returns the userIDs associated with this public key.

Returns the userIDs associated with this public key.

Attributes

Supertypes
trait Iterable[String]
trait IterableFactoryDefaults[String, Iterable]
trait IterableOps[String, Iterable, Iterable[String]]
trait IterableOnceOps[String, Iterable, Iterable[String]]
trait IterableOnce[String]
class Object
trait Matchable
class Any
Show all
Self type
userIDs.type

Value members

Concrete methods

def algorithm: Int
def algorithmName: String
def bitStrength: Int
def creationTime: Date
def encrypt(data: InputStream, output: OutputStream, fileName: String, size: Long, lastMod: Date): Unit
def encryptFile(input: File, output: File): Unit

Encrypts a file such that only the secret key associated with this public key can decrypt.

Encrypts a file such that only the secret key associated with this public key can decrypt.

Attributes

def encryptString(input: String): String

Encrypts a string such that only the secret key associated with this public key could decrypt.

Encrypts a string such that only the secret key associated with this public key could decrypt.

Attributes

def fingerprint: Array[Byte]
def isRevoked: Boolean
def keyID: Long

The identifier for this key.

The identifier for this key.

Attributes

def saveTo(output: OutputStream): Unit

Saves the current entity to an output stream.

Saves the current entity to an output stream.

Attributes

def signaturesForId(id: String): Iterable[Signature]
def verifyMessageStream(input: InputStream, output: OutputStream): Boolean

Verifies a signed message and extracts the contents.

Verifies a signed message and extracts the contents.

Value parameters

input

The incoming PGP message.

output

The decoded and verified message.

Attributes

def verifySignatureStreams(msg: InputStream, signature: InputStream): Boolean

Verifies a signature stream against an input stream.

Verifies a signature stream against an input stream.

Value parameters

msg

The input stream containing the raw message to verify.

msgName

the name tied in the signature for this object. For a file, this is the filename.

signature

The input stream containing the PGP signature.

Attributes

Inherited methods

def saveToFile(file: File): Unit

Saves the current entity to a file.

Saves the current entity to a file.

Attributes

Inherited from:
StreamingSaveable
def saveToString: String

Saves the current entity into a string.

Saves the current entity into a string.

Attributes

Inherited from:
StreamingSaveable
final def verifyMessageFile(input: File, output: File): Boolean

Reads in a PGP message from a file, verifies the signature and writes to the output file.

Reads in a PGP message from a file, verifies the signature and writes to the output file.

Attributes

Inherited from:
PublicKeyLike
protected def verifyMessageStreamHelper(input: InputStream, output: OutputStream)(getKey: Long => PGPPublicKey): Boolean

Attributes

Inherited from:
PublicKeyLike
final def verifyMessageString(input: String): String

Reads in a PGP message and from a string, verifies the signature and returns the raw content.

Reads in a PGP message and from a string, verifies the signature and returns the raw content.

Attributes

Inherited from:
PublicKeyLike
final def verifySignatureFile(raw: File, signature: File): Boolean

Reads in a raw file, verifies the signature file is valid for this file.

Reads in a raw file, verifies the signature file is valid for this file.

Attributes

Inherited from:
PublicKeyLike
protected def verifySignatureStreamsHelper(msg: InputStream, signature: InputStream)(getKey: Long => PGPPublicKey): Boolean

Verifies that a stream was signed correctly by another stream.

Verifies that a stream was signed correctly by another stream.

Attributes

Throws
KeyNotFoundException

is signature contains an unknown public key.

Inherited from:
PublicKeyLike
final def verifySignatureString(msg: String, signature: String): Boolean

Reads in a PGP message from a string, verifies the signature string is accurate for the message.

Reads in a PGP message from a string, verifies the signature string is accurate for the message.

Attributes

Inherited from:
PublicKeyLike

Concrete fields

val nested: PGPPublicKey
lazy override val toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.