Package tss.tpm

Class TPM2_RSA_Encrypt_REQUEST

  • All Implemented Interfaces:
    TpmMarshaller

    public class TPM2_RSA_Encrypt_REQUEST
    extends ReqStructure
    This command performs RSA encryption using the indicated padding scheme according to IETF RFC 8017. If the scheme of keyHandle is TPM_ALG_NULL, then the caller may use inScheme to specify the padding scheme. If scheme of keyHandle is not TPM_ALG_NULL, then inScheme shall either be TPM_ALG_NULL or be the same as scheme (TPM_RC_SCHEME).
    • Field Detail

      • keyHandle

        public TPM_HANDLE keyHandle
        Reference to public portion of RSA key to use for encryption Auth Index: None
      • message

        public byte[] message
        Message to be encrypted NOTE 1 The data type was chosen because it limits the overall size of the input to no greater than the size of the largest RSA public key. This may be larger than allowed for keyHandle.
      • inScheme

        public TPMU_ASYM_SCHEME inScheme
        The padding scheme to use if scheme associated with keyHandle is TPM_ALG_NULL One of: TPMS_KEY_SCHEME_ECDH, TPMS_KEY_SCHEME_ECMQV, TPMS_SIG_SCHEME_RSASSA, TPMS_SIG_SCHEME_RSAPSS, TPMS_SIG_SCHEME_ECDSA, TPMS_SIG_SCHEME_ECDAA, TPMS_SIG_SCHEME_SM2, TPMS_SIG_SCHEME_ECSCHNORR, TPMS_ENC_SCHEME_RSAES, TPMS_ENC_SCHEME_OAEP, TPMS_SCHEME_HASH, TPMS_NULL_ASYM_SCHEME.
      • label

        public byte[] label
        Optional label L to be associated with the message Size of the buffer is zero if no label is present NOTE 2 See description of label above.
    • Constructor Detail

      • TPM2_RSA_Encrypt_REQUEST

        public TPM2_RSA_Encrypt_REQUEST()
      • TPM2_RSA_Encrypt_REQUEST

        public TPM2_RSA_Encrypt_REQUEST​(TPM_HANDLE _keyHandle,
                                        byte[] _message,
                                        TPMU_ASYM_SCHEME _inScheme,
                                        byte[] _label)
        Parameters:
        _keyHandle - Reference to public portion of RSA key to use for encryption Auth Index: None
        _message - Message to be encrypted NOTE 1 The data type was chosen because it limits the overall size of the input to no greater than the size of the largest RSA public key. This may be larger than allowed for keyHandle.
        _inScheme - The padding scheme to use if scheme associated with keyHandle is TPM_ALG_NULL One of: TPMS_KEY_SCHEME_ECDH, TPMS_KEY_SCHEME_ECMQV, TPMS_SIG_SCHEME_RSASSA, TPMS_SIG_SCHEME_RSAPSS, TPMS_SIG_SCHEME_ECDSA, TPMS_SIG_SCHEME_ECDAA, TPMS_SIG_SCHEME_SM2, TPMS_SIG_SCHEME_ECSCHNORR, TPMS_ENC_SCHEME_RSAES, TPMS_ENC_SCHEME_OAEP, TPMS_SCHEME_HASH, TPMS_NULL_ASYM_SCHEME.
        _label - Optional label L to be associated with the message Size of the buffer is zero if no label is present NOTE 2 See description of label above.
    • Method Detail

      • inSchemeScheme

        public TPM_ALG_ID inSchemeScheme()
        Scheme selector
      • toTpm

        public byte[] toTpm()
        Deprecated.
        Returns:
        Wire (marshaled) representation of this object
      • fromBytes

        public static TPM2_RSA_Encrypt_REQUEST fromBytes​(byte[] byteBuf)
        Static marshaling helper
        Parameters:
        byteBuf - Wire representation of the object
        Returns:
        New object constructed from its wire representation
      • fromTpm

        public static TPM2_RSA_Encrypt_REQUEST fromTpm​(byte[] byteBuf)
        Deprecated.
        Use fromBytes(byte[]) instead
        Parameters:
        byteBuf - Wire representation of the object
        Returns:
        New object constructed from its wire representation
      • fromTpm

        public static TPM2_RSA_Encrypt_REQUEST fromTpm​(TpmBuffer buf)
        Static marshaling helper
        Parameters:
        buf - Wire representation of the object
        Returns:
        New object constructed from its wire representation
      • toStringInternal

        public void toStringInternal​(TpmStructurePrinter _p,
                                     int d)
        Description copied from class: TpmStructure
        Serialize this object to the structure printer
        Overrides:
        toStringInternal in class TpmStructure
        Parameters:
        _p - The structure accumulator
        d - The data to serialize
      • numHandles

        public int numHandles()
        Overrides:
        numHandles in class CmdStructure
        Returns:
        Number of TPM handles contained (as fields) in this data structure
      • numAuthHandles

        public int numAuthHandles()
        Overrides:
        numAuthHandles in class ReqStructure
        Returns:
        Number of authorization TPM handles contained in this data structure
      • getHandles

        public TPM_HANDLE[] getHandles()
        Overrides:
        getHandles in class ReqStructure
        Returns:
        An array of TPM handles contained in this TPM request data structure
      • sessEncInfo

        public SessEncInfo sessEncInfo()
        Overrides:
        sessEncInfo in class CmdStructure
        Returns:
        Non-zero size info of the encryptable command/response parameter if session based encryption can be applied to this object (i.e. its first non-handle field is marshaled in size-prefixed form). Otherwise returns zero initialized struct.