Beispiel #1
0
        public static SymmCipher CreateFromPublicParms(IPublicParmsUnion parms)
        {
            switch (parms.GetUnionSelector())
            {
            case TpmAlgId.Rsa:
                return(Create((parms as RsaParms).symmetric));

            default:
                throw new Exception("Unsupported algorithm");
            }
        }
Beispiel #2
0
        public static SymmCipher CreateFromPublicParms(IPublicParmsUnion parms)
        {
            switch (parms.GetUnionSelector())
            {
            case TpmAlgId.Rsa:
                return(Create((parms as RsaParms).symmetric));

            case TpmAlgId.Ecc:
                return(Create((parms as EccParms).symmetric));

            default:
                Globs.Throw <ArgumentException>("CreateFromPublicParms: Unsupported algorithm");
                return(null);
            }
        }
Beispiel #3
0
 public static SymmCipher CreateFromPublicParms(IPublicParmsUnion parms)
 {
     switch (parms.GetUnionSelector())
     {
         case TpmAlgId.Rsa:
             return Create((parms as RsaParms).symmetric);
         case TpmAlgId.Ecc:
             return Create((parms as EccParms).symmetric);
         default:
             Globs.Throw<ArgumentException>("CreateFromPublicParms: Unsupported algorithm");
             return null;
     }
 }
Beispiel #4
0
 ///<param name = "the_nameAlg">algorithm used for computing the Name of the object NOTE	The "+" indicates that the instance of a TPMT_PUBLIC may have a "+" to indicate that the nameAlg may be TPM_ALG_NULL.</param>
 ///<param name = "the_objectAttributes">attributes that, along with type, determine the manipulations of this object</param>
 ///<param name = "the_authPolicy">optional policy for using this key The policy is computed using the nameAlg of the object. NOTE Shall be the Empty Policy if no authorization policy is present.</param>
 ///<param name = "the_parameters">the algorithm or structure details(One of KeyedhashParms, SymcipherParms, RsaParms, EccParms, AsymParms)</param>
 ///<param name = "the_unique">the unique identifier of the structure For an asymmetric key, this would be the public key.(One of Tpm2bDigestKeyedhash, Tpm2bDigestSymcipher, Tpm2bPublicKeyRsa, EccPoint)</param>
 public TpmPublic(
 TpmAlgId the_nameAlg,
 ObjectAttr the_objectAttributes,
 byte[] the_authPolicy,
 IPublicParmsUnion the_parameters,
 IPublicIdUnion the_unique
 )
 {
     this.nameAlg = the_nameAlg;
     this.objectAttributes = the_objectAttributes;
     this.authPolicy = the_authPolicy;
     this.parameters = the_parameters;
     this.unique = the_unique;
 }
Beispiel #5
0
 ///<param name = "the_parameters">the algorithm details(One of KeyedhashParms, SymcipherParms, RsaParms, EccParms, AsymParms)</param>
 public PublicParms(
 IPublicParmsUnion the_parameters
 )
 {
     this.parameters = the_parameters;
 }
Beispiel #6
0
 public void TestParms(
     IPublicParmsUnion parameters
 )
 {
     Tpm2TestParmsRequest inS = new Tpm2TestParmsRequest();
     inS.parameters = parameters;
     TpmStructureBase outSBase;
     DispatchMethod(TpmCc.TestParms, (TpmStructureBase) inS, typeof(Tpm2TestParmsResponse), out outSBase, 0, 0);
 }
Beispiel #7
0
 ///<param name = "the_parameters">algorithm parameters to be validated(One of KeyedhashParms, SymcipherParms, RsaParms, EccParms, AsymParms)</param>
 public Tpm2TestParmsRequest(
 IPublicParmsUnion the_parameters
 )
 {
     this.parameters = the_parameters;
 }
Beispiel #8
0
 public static SymmCipher CreateFromPublicParms(IPublicParmsUnion parms)
 {
     switch (parms.GetUnionSelector())
     {
         case TpmAlgId.Rsa:
             return Create((parms as RsaParms).symmetric);
         default:
             throw new Exception("Unsupported algorithm");
     }
 }