类 MbedAkeySe

  • 所有已实现的接口:
    SecureElement

    public class MbedAkeySe
    extends Object
    implements SecureElement
    Mbed akey secure element. It provides mbed_akey type secure element.
    • 构造器详细资料

      • MbedAkeySe

        public MbedAkeySe​(Device device,
                          DeviceKey deviceKey)
        Construct a mbed akey secure element using the specified device and device key
        参数:
        device - specified device
        deviceKey - specified device key
    • 方法详细资料

      • generateId

        public String generateId()
        Generate device unique id
        指定者:
        generateId 在接口中 SecureElement
        返回:
        device unique id in ascii encoding
      • encryptThenSign

        public CipherMessage encryptThenSign​(PlainMessage plainMessage)
        Encrypt and sign provided plain message
        指定者:
        encryptThenSign 在接口中 SecureElement
        参数:
        plainMessage - specified plain message
        返回:
        cipher message, including encrypted message and its signature
      • encryptThenSign

        public CipherMessage encryptThenSign​(PlainMessage plainMessage,
                                             byte[] signPrivateKey)
        Encrypt plain message, and sign the signature with provided private key
        指定者:
        encryptThenSign 在接口中 SecureElement
        参数:
        plainMessage - specified plain message
        signPrivateKey - specified signature private key
        返回:
        cipher message, including encrypted message and its signature
      • decrypt

        public byte[] decrypt​(byte[] encryption)
        Decrypt encrypted message
        指定者:
        decrypt 在接口中 SecureElement
        参数:
        encryption - specified encrypted message in byte array
        返回:
        plain message in byte array
      • verifySignature

        public void verifySignature​(byte[] message,
                                    byte[] signature)
        Verify message signature. If failed, an exception will be thrown.
        指定者:
        verifySignature 在接口中 SecureElement
        参数:
        message - specified message in byte array
        signature - specified signature in byte array
      • verifyThenDecrypt

        public PlainMessage verifyThenDecrypt​(CipherMessage cipherMessage)
        Verify message and decrypt cipher message.
        指定者:
        verifyThenDecrypt 在接口中 SecureElement
        参数:
        cipherMessage - specified cipher message
        返回:
        plain message decrypted from cipher message, if failed an exception will be thrown.
      • parseCipherMessage

        public CipherMessage parseCipherMessage​(byte[] cipherMessage)
        Parse byte array cipher message.
        指定者:
        parseCipherMessage 在接口中 SecureElement
        参数:
        cipherMessage - specified cipher message in byte array
        返回:
        cipher message object
      • parsePlainMessage

        public PlainMessage parsePlainMessage​(byte[] plainMessage)
        Parse byte array plain message.
        指定者:
        parsePlainMessage 在接口中 SecureElement
        参数:
        plainMessage - specified plain message
        返回:
        plain message object
      • parseActiveMessage

        public ActiveMessage parseActiveMessage​(byte[] activeMessage)
        Parse byte array active message
        指定者:
        parseActiveMessage 在接口中 SecureElement
        参数:
        activeMessage - specified active message
        返回:
        active message object
      • checkActiveMessage

        public void checkActiveMessage​(ActiveMessage activeMessage)
        Valid active message with secure element. If failed, an exception will be thrown.
        指定者:
        checkActiveMessage 在接口中 SecureElement
        参数:
        activeMessage - specified active message