示例#1
0
文件: tpm.go 项目: carriercomm/pond
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
}
示例#2
0
文件: tpm.go 项目: carriercomm/pond
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
}