SEReader

Tags: 2.5 Privileged

Description

SEReader interface provides ways to connect to secure element this device.

Properties

  • isSEPresent If a secure element is present
  • type Type of SecureElement

Methods

  • SEReader.openSession() Opens a session with the Secure Element.

  • SEReader.closeAll() Closes all sessions associated with this Reader and its associated channels.

  • SEReader.reset() This method resets the physical interface of the Secure Element. The enabling process of the physical interface MUST be replayed. If the physical interface does not support or allow the operation, this method MUST fail with SEUnsupportedException. error.

Example

window.navigator.seManager.getSEReaders()
.then((readers) => {
   window.reader = readers[0];
   return readers[0].openSession();
   })
.then((session)=> {
  if (session) {
    console.log("Open a seesion successfully")
  }
  else {
    console.log("Failed to open a session")
  }
  window.reader.closeAll();
})
.catch((err) => {
  console.log("Failed to open a session")
  window.reader.closeAll();
});