Skip to content

Commit c4319dc

Browse files
authored
Update README.md
1 parent 1f0dc54 commit c4319dc

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,19 @@ The missing key management bridge between (Open)SSH and Java worlds. `SSHProvide
1212
- verify and create [`SSHSIG`](https://github.com/openssh/openssh-portable/blob/master/PROTOCOL.sshsig) and raw SSH signature formats, also with [SSH certificates](https://github.com/openssh/openssh-portable/blob/master/PROTOCOL.certkeys) (including [webauthn signatures](https://github.com/openssh/openssh-portable/blob/master/PROTOCOL.u2f#L222-L246))
1313
- use existing OpenSSH [`allowed_signers`](https://man.openbsd.org/ssh-keygen.1#ALLOWED_SIGNERS) trust anchoring files (as used by Git, for example)
1414

15-
Pure Java with _zero_ 3rd party dependencies!
15+
Pure Java with _zero_ 3rd party dependencies.
1616

1717
> [!TIP]
1818
> Sign easily with local hardware keys on remote machines with SSH agent forwarding ❤️
1919
2020
## How to use
21-
There is also a longer [Tutorial](https://github.com/martinpaljak/java-ssh-provider/wiki/Tutorial) (WIP)
21+
There is also a longer [Tutorial](https://github.com/martinpaljak/java-ssh-provider/wiki/Tutorial) (WIP).
2222
## Access keys in agent
2323

2424
Generate standard signatures with a key in hardware via `$SSH_AUTH_SOCK`
2525

2626
> [!NOTE]
27-
> Keys are _reported_ by their public key fingerprint (same as shown by `ssh-add -l`) but _can also be addressed_ by full public key/certificate string (as shown by `ssh-add -L` or available in a `.pub` file).
27+
> Keys are _reported_ by their public key fingerprint (same as shown by `ssh-add -l`) but can _also_ be addressed by full public key/certificate string (as shown by `ssh-add -L` or available in a `.pub` file).
2828
2929

3030
```java
@@ -44,7 +44,7 @@ for (String alias : Collections.list(ks.aliases())) {
4444
String alias = "SHA256:5DmYCoIkCgEoOnbx3K+UXLhHVh8pX8GXgf7IS8i9QPo";
4545

4646
PrivateKey key = (PrivateKey) ks.getKey(alias);
47-
Signature sig = Signature.getInstance("SHA256withECDSA"); // standard interoperable signature format
47+
Signature sig = Signature.getInstance("SHA256withECDSA");
4848
sig.initSign(key);
4949

5050
// Continue as usual
@@ -67,7 +67,7 @@ Verify it with Java (or vice-versa):
6767
PublicKey pub = SSHIdentity.fromPath(Paths.get("/tmp/id_ed25519.pub"));
6868
byte[] signature = SSHSIG.fromArmored(Paths.get("/tmp/helloworld.txt.sig"));
6969
Signature sig = Signature.getInstance("SSHSIG");
70-
sig.setParameter(new SSHSIGVerificationSpec("file", "SHA-512")); // Can be omitted for verification
70+
sig.setParameter(new SSHSIGVerificationSpec("file"));
7171
sig.initVerify(pub);
7272
sig.update(Files.readAllBytes(Paths.get("/tmp/helloworld.txt")))
7373
Assert.assertTrue(sig.verify(signature));

0 commit comments

Comments
 (0)