Пример #1
0
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
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
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))
}