diff options
| author | Nicola Murino <nicola.murino@gmail.com> | 2024-09-22 08:40:45 +0000 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2024-09-22 08:47:39 +0000 |
| commit | 166329992eec585bea4247dcd6c639966604e340 (patch) | |
| tree | 9b3be0a90be190caf413198b0439540c1c64ca83 /design | |
| parent | b0ae23a0aad80b8587036ece8a621884d59c000b (diff) | |
| download | go-x-proposal-166329992eec585bea4247dcd6c639966604e340.tar.xz | |
design/68723-crypto-ssh-v2.md: crypto.Signer returns ed25519 keys as value
This is now consistent with x509.MarshalPKCS8PrivateKey, see
golang/go#51974
Change-Id: Id643ef260facfb38730bc3db30e63555aa3d64a4
GitHub-Last-Rev: 5e5819e13c3c59b5b3d13b2ad6722f526c11aeb0
GitHub-Pull-Request: golang/proposal#53
Reviewed-on: https://go-review.googlesource.com/c/proposal/+/614278
Commit-Queue: Nicola Murino <nicola.murino@gmail.com>
Reviewed-by: Nicola Murino <nicola.murino@gmail.com>
Auto-Submit: Nicola Murino <nicola.murino@gmail.com>
Diffstat (limited to 'design')
| -rw-r--r-- | design/68723-crypto-ssh-v2.md | 5 | ||||
| -rw-r--r-- | design/68723/ssh.html | 3 |
2 files changed, 8 insertions, 0 deletions
diff --git a/design/68723-crypto-ssh-v2.md b/design/68723-crypto-ssh-v2.md index 8827f14..5210f9e 100644 --- a/design/68723-crypto-ssh-v2.md +++ b/design/68723-crypto-ssh-v2.md @@ -391,6 +391,9 @@ type PrivateKeySigner struct { Signer } +// CryptoSigner returns the private key associated with the Signer. It returns a +// *rsa.PrivateKey, an *ecdsa.PrivateKey or an ed25519.PrivateKey (not a pointer). +// Note: in v1 ed25519.PrivateKey was returned as a pointer. func (k *PrivateKeySigner) CryptoSigner() crypto.Signer func ParsePrivateKey(pemBytes []byte) (*PrivateKeySigner, error) @@ -398,6 +401,8 @@ func ParsePrivateKey(pemBytes []byte) (*PrivateKeySigner, error) func ParsePrivateKeyWithPassphrase(pemBytes, passphrase []byte) (*PrivateKeySigner, error) ``` +Differently from v1, `CryptoSigner` returns ed25519.PrivateKey as value and not as pointer, see [golang/go#51974](https://github.com/golang/go/issues/51974). + ### Add MarshalPrivateKeyOptions Instead of passing options as function parameters to `MarshalPrivateKey` add a struct for options. diff --git a/design/68723/ssh.html b/design/68723/ssh.html index ff90f86..47c353a 100644 --- a/design/68723/ssh.html +++ b/design/68723/ssh.html @@ -1965,6 +1965,9 @@ encoded private key and passphrase. It supports the same keys as <a href="#ParsePrivateKey">ssh.ParsePrivateKey</a>. <h4 id="PrivateKeySigner.CryptoSigner">func (*PrivateKeySigner) CryptoSigner</h4> <pre class="chroma"><span class="kd">func</span> <span class="p">(</span><span class="nx">k</span> <span class="o">*</span><a href="#PrivateKeySigner"><span class="nx">PrivateKeySigner</span></a><span class="p">)</span> <span class="nf">CryptoSigner</span><span class="p">()</span> <a href="https://pkg.go.dev/crypto"><span class="nx">crypto</span></a><span class="p">.</span><a href="https://pkg.go.dev/crypto#Signer"><span class="nx">Signer</span></a></pre> + <p>CryptoSigner returns the private key associated with the Signer. It returns a + *rsa.PrivateKey, an *ecdsa.PrivateKey or an ed25519.PrivateKey (not a pointer). + Note: in v1 ed25519.PrivateKey was returned as a pointer. <h3 id="PublicKey">type PublicKey</h3> <pre class="chroma"><span class="kd">type</span> <span class="nx">PublicKey</span> <span class="kd">interface</span> <span class="p">{</span> <span class="c1">// Type returns the key format name, e.g. "ssh-rsa". |
