FAQ

On Mon, Oct 22, 2012 at 11:22 AM, roger peppe wrote:
Thanks for any help.
In generateCert you're passing priv as the last argument to
createCertificate, but you want to sign it with the CA cert, so it
should be signer.PrivateKey.

Fixed version: http://play.golang.org/p/tispiUVmdm


Cheers

AGL

--

Search Discussions

  • Roger peppe at Oct 22, 2012 at 4:42 pm

    On 22 October 2012 16:27, Adam Langley wrote:
    On Mon, Oct 22, 2012 at 11:22 AM, roger peppe wrote:
    Thanks for any help.
    In generateCert you're passing priv as the last argument to
    createCertificate, but you want to sign it with the CA cert, so it
    should be signer.PrivateKey.

    Fixed version: http://play.golang.org/p/tispiUVmdm
    Doh! Something stupid it was. Thanks!

    Might it be reasonable to put some verification code into x509.CreateCertificate
    to check that the private key used corresponds to the public key in
    the signer certificate?

    --
  • Roger peppe at Oct 22, 2012 at 7:27 pm
    I'm trying to do a simple thing with the X509 package: generate
    a root key and certificate, and use them to sign another key.

    Unfortunately I can't get the verification to pass:

    http://play.golang.org/p/mvLXUJl-ag

    It looks like the call to encrypt in rsa.VerifyPKCS1v15 is returning
    garbage, so I suspect a bad key somewhere, but I'd like to know
    if I'm doing something stupid before I start peering at the standards
    and delving for a bug...

    Thanks for any help.

    cheers,
    rog.

    --

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedOct 22, '12 at 3:27p
activeOct 22, '12 at 7:27p
posts3
users2
websitegolang.org

2 users in discussion

Roger peppe: 2 posts Adam Langley: 1 post

People

Translate

site design / logo © 2023 Grokbase