INNER CODE UNIT · Go
pointLen
go-piv/go-ykpiv · generate.go:109
pointLen := (curve.Params().BitSize + 7) / 8
if len(publicPointSpec) != 2*pointLen+1 {
return nil, fmt.Errorf("ykpiv: decodeYubikeyECPublicKey: EC public point bytes wrong length; %d", len(publicPointSpec))
}
x := new(big.Int)
x.SetBytes(publicPointSpec[1 : 1+pointLen])
y := new(big.Int)
y.SetBytes(publicPointSpec[1+pointLen : 1+2*pointLen])
return &ecdsa.PublicKey{
Curve: curve,
X: x,
Y: y,
}, nil
}
// Generate an RSA Keypair in slot `id` (using a modulus size of `bits`),