// NewRsaPublicKey creates a new JWK using the given key func NewRsaPublicKey(pk *rsa.PublicKey) (*RsaPublicKey, error) { k := &RsaPublicKey{ EssentialHeader: &EssentialHeader{KeyType: "RSA"}, N: buffer.Buffer(pk.N.Bytes()), E: buffer.FromUint(uint64(pk.E)), } return k, nil }
func NewRawKeyFromPublicKey(pubkey *rsa.PublicKey) *rawkey { r := &rawkey{} r.N = buffer.Buffer(pubkey.N.Bytes()) r.E = buffer.FromUint(uint64(pubkey.E)) return r }