Rename Type() to KeyType() to be more descriptive.

This commit is contained in:
Christopher Dudley
2017-12-15 16:01:44 -05:00
committed by Jeff
parent 193b24e768
commit 96ce3e554e

10
key.go
View File

@@ -64,17 +64,17 @@ type PublicKey interface {
// format // format
MarshalPKIXPublicKeyDER() (der_block []byte, err error) MarshalPKIXPublicKeyDER() (der_block []byte, err error)
// Type returns an identifier for what kind of key is represented by this // KeyType returns an identifier for what kind of key is represented by this
// object. // object.
Type() KeyType KeyType() KeyType
// BaseType returns an identifier for what kind of key is represented // BaseType returns an identifier for what kind of key is represented
// by this object. // by this object.
// Keys that share same algorithm but use different legacy formats // Keys that share same algorithm but use different legacy formats
// will have the same BaseType. // will have the same BaseType.
// //
// For example, a key with a `Type() == KeyTypeRSA` and a key with a // For example, a key with a `KeyType() == KeyTypeRSA` and a key with a
// `Type() == KeyTypeRSA2` would both have `BaseType() == KeyTypeRSA`. // `KeyType() == KeyTypeRSA2` would both have `BaseType() == KeyTypeRSA`.
BaseType() KeyType BaseType() KeyType
evpPKey() *C.EVP_PKEY evpPKey() *C.EVP_PKEY
@@ -101,7 +101,7 @@ type pKey struct {
func (key *pKey) evpPKey() *C.EVP_PKEY { return key.key } func (key *pKey) evpPKey() *C.EVP_PKEY { return key.key }
func (key *pKey) Type() KeyType { func (key *pKey) KeyType() KeyType {
return KeyType(C.EVP_PKEY_id(key.key)) return KeyType(C.EVP_PKEY_id(key.key))
} }