Tpm2Lib.TpmHandle.GetName C# (CSharp) Method

GetName() public method

Get the TPM name of the associated entity. If the entity is a transient object, persistent object or NV index, the name must have been previously set explicitly by the caller (by means of SetName() or GetName(Tpm2 tpm) methods) or implicitly by the framework (when an object is created by means of CreatePrimary, CreateLoaded or Create command). Otherwise the name is a 4-byte TPM representation of the handle value.
public GetName ( ) : byte[]
return byte[]
        public byte[] GetName()
        {
            Ht ht = GetType();
            switch (ht)
            {
                case Ht.Transient:
                case Ht.Persistent:
                case Ht.NvIndex:
                    return _Name;
                case Ht.Pcr:
                case Ht.HmacSession:
                case Ht.PolicySession:
                case Ht.Permanent:
                    return Marshaller.GetTpmRepresentation(handle);
                default:
                    return null;
            }
        }

Same methods

TpmHandle::GetName ( Tpm2 tpm ) : byte[]