FAQ
There's no trivial way to do this that I'm aware of.
The currently supported types for Certifice.PublicKey are
crypto.rsa.PublicKey and crypto.dsa.PublicKey.

You can look at the PublicKey.N.BitLen() field which is a big.Int to
determine size.

Seems like a method that would be worth adding to the Certificate struct,
or maybe there's a simpler way?
On Fri, Oct 12, 2012 at 1:31 AM, Paul van Brouwershaven wrote:

I'm try to get the bit size of the public key part of a certificate but
for some reason this is not listed by default in the go x509 Certificate
struct.

http://golang.org/pkg/crypto/x509/#Certificate

Does anyone know an other (easy) way to calculate the key size of a
certificate?

Thanks,

Paul

--

--

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 2 of 3 | next ›
Discussion Overview
groupgolang-nuts @
categoriesgo
postedOct 12, '12 at 7:31a
activeOct 13, '12 at 9:13p
posts3
users3
websitegolang.org

People

Translate

site design / logo © 2021 Grokbase