func PrivateKeyFromInterface(kt KeyType, key interface{}) (*PrivKey, error) {
	buf, err := kt.ParsePrivateKeyInterface(key)
	if err != nil {
		return nil, errIncorrectKeyFormat
	}

	s := base64.StdEncoding.EncodeToString(buf)

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