示例#1
0
文件: key.go 项目: lestrrat/go-xmlsec
func LoadKeyFromFile(file string, format KeyDataFormat) (*Key, error) {
	ptr, err := clib.XMLSecCryptoAppKeyLoad(file, clib.KeyDataFormat(format))
	if err != nil {
		return nil, err
	}
	return &Key{ptr: ptr}, nil
}
示例#2
0
文件: key.go 项目: lestrrat/go-xmlsec
func LoadKeyFromBytes(data []byte, format KeyDataFormat) (*Key, error) {
	ptr, err := clib.XMLSecCryptoAppKeyLoadMemory(data, clib.KeyDataFormat(format))
	if err != nil {
		return nil, err
	}
	return &Key{ptr: ptr}, nil
}
示例#3
0
文件: key.go 项目: lestrrat/go-xmlsec
func (k *Key) LoadCertFromFile(fn string, format KeyDataFormat) error {
	return clib.XMLSecCryptoAppKeyCertLoad(k, fn, clib.KeyDataFormat(format))
}
示例#4
0
func (km *KeyManager) LoadCert(buf []byte, format KeyDataFormat, typ KeyDataType) error {
	return clib.XMLSecKeysMngrCertLoadMemory(km, buf, clib.KeyDataFormat(format), clib.KeyDataType(typ))
}