Beispiel #1
0
func (c *Context) GetPolicy() (*Policy, error) {
	p := new(Policy)
	if result := C.Tspi_GetPolicyObject(C.TSS_HOBJECT(c.tpm), C.TSS_POLICY_USAGE, &p.policy); isError(result) {
		return nil, Error{result}
	}

	return p, nil
}
Beispiel #2
0
func (rsa *RSA) GetPolicy() (*Policy, error) {
	p := new(Policy)
	if result := C.Tspi_GetPolicyObject(C.TSS_HOBJECT(rsa.handle), C.TSS_POLICY_USAGE, &p.policy); isError(result) {
		return nil, Error{result}
	}

	return p, nil
}