Skip to content

Commit

Permalink
Fix armored output having incorrect label
Browse files Browse the repository at this point in the history
Signed-off-by: Wiktor Kwapisiewicz <[email protected]>
  • Loading branch information
wiktor-k committed Nov 30, 2023
1 parent 2e9db45 commit b42aa24
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ from pysequoia import sign
s = Cert.from_file("signing-key.asc")
signed = sign(s.secrets.signer(), "data to be signed".encode("utf8"))
print(f"Signed data: {signed}")
assert "PGP MESSAGE" in str(signed)
```

## Certificates
Expand Down
8 changes: 1 addition & 7 deletions src/sign.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,10 @@ pub fn sign(signer: PySigner, bytes: &[u8]) -> PyResult<Cow<'static, [u8]>> {
let mut sink = vec![];
{
let message = Message::new(&mut sink);

let message = Armorer::new(message)
.kind(openpgp::armor::Kind::Signature)
.build()?;
let message = Armorer::new(message).build()?;
let message = Signer::new(message, signer).build()?;

let mut message = LiteralWriter::new(message).build()?;

message.write_all(bytes)?;

message.finalize()?;
}

Expand Down

0 comments on commit b42aa24

Please sign in to comment.