Skip to content
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
6 changes: 3 additions & 3 deletions gpg-library/src/main/scala/com/jsuereth/pgp/PrivateKey.scala
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class SecretKey(val nested: PGPSecretKey) {
sGen.init(PGPSignature.BINARY_DOCUMENT, pgpPrivKey)
for (name <- this.publicKey.userIDs) {
val spGen = new PGPSignatureSubpacketGenerator()
spGen.setSignerUserID(false, name)
spGen.addSignerUserID(false, name)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sGen.setHashedSubpackets(spGen.generate())
}
val cGen = new PGPCompressedDataGenerator(CompressionAlgorithmTags.ZLIB)
Expand Down Expand Up @@ -149,9 +149,9 @@ class SecretKey(val nested: PGPSecretKey) {
sGen.generateOnePassVersion(false).encode(bOut)
val spGen = new PGPSignatureSubpacketGenerator()
val isHumanReadable = true
spGen.setNotationData(true, isHumanReadable, notation._1, notation._2)
spGen.addNotationData(true, isHumanReadable, notation._1, notation._2)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// TODO - Embedd this key's signatures?
userIDs.headOption foreach (spGen.setSignerUserID(false, _))
userIDs.headOption foreach (spGen.addSignerUserID(false, _))

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


val packetVector = spGen.generate()
sGen.setHashedSubpackets(packetVector)
Expand Down
4 changes: 2 additions & 2 deletions gpg-library/src/main/scala/com/jsuereth/pgp/PublicKey.scala
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ class PublicKey(val nested: PGPPublicKey) extends PublicKeyLike with StreamingSa
def bitStrength = nested.getBitStrength
def creationTime = nested.getCreationTime
def fingerprint = nested.getFingerprint
def isRevoked = nested.isRevoked
def isRevoked = nested.hasRevocation

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

def algorithm = nested.getAlgorithm
def algorithmName = nested.getAlgorithm match {
case PublicKeyAlgorithmTags.RSA_ENCRYPT | PublicKeyAlgorithmTags.RSA_GENERAL | PublicKeyAlgorithmTags.RSA_SIGN =>
"RSA"
case PublicKeyAlgorithmTags.DSA => "DSA"
case PublicKeyAlgorithmTags.EC => "EC"
case PublicKeyAlgorithmTags.ECDH => "EC"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

case PublicKeyAlgorithmTags.ELGAMAL_ENCRYPT | PublicKeyAlgorithmTags.ELGAMAL_GENERAL => "ElGamal"
case PublicKeyAlgorithmTags.ECDSA => "ECDSA"
case _ => "Unknown"
Expand Down