func PublicKeyFromInterface(kt KeyType, key interface{}) (*PubKey, error) {
	buf, err := kt.ParsePublicKeyInterface(key)
	if err != nil {
		return nil, errIncorrectKeyFormat
	}

	s := base64.StdEncoding.EncodeToString(buf)

	return &PubKey{
		Type:        kt,
		S:           s,
		B:           []byte(s),
		K:           key,
		Description: "",
	}, nil
}
// PublicKeyFromInterface creates a new key based on an interface{} (like rsa.PublicKey)
PublicKeyFromInterface creates a new key based on an interface{} (like rsa.PublicKey)
// PublicKeyFromInterface creates a new key based on an interface {} ( like rsa . PublicKey )
func PublicKeyFromInterface(kt KeyType, key interface{}) (*PubKey, error) {
	buf, err := kt.ParsePublicKeyInterface(key)
	if err != nil {
		return nil, errIncorrectKeyFormat
	}
	s := base64.StdEncoding.EncodeToString(buf)
	return &PubKey{
		Type:        kt,
		S:           s,
		B:           []byte(s),
		K:           key,
		Description: "",
	}, nil
}
func PublicKeyFromInterface ( kt KeyType , key interface { } ) ( * PubKey , error ) { buf , err := kt . ParsePublicKeyInterface ( key ) if err != nil { return nil , errIncorrectKeyFormat } s := base64 . StdEncoding . EncodeToString ( buf ) return & PubKey { Type : kt , S : s , B : [ ] byte ( s ) , K : key , Description : " " , } , nil }
PublicKeyFromInterface creates a new key based on an interface{} (like rsa.PublicKey)
PublicKeyFromInterface creates a new key based on an interface {} ( like rsa . PublicKey )