         dataSigBytes = (parseInt(n,16) for n in dataSig.match(/\w\w/g))
         sha = new JSUCrypt.hash.SHA256()
         domain = JSUCrypt.ECFp.getEcDomainByName("secp256k1")
+        if isBeta
+          Attestation = Attestations["0000000000000000"]
+        else
+          Attestation = Attestations[result.bytes(0, 8).toString()]
         affinePoint = new JSUCrypt.ECFp.AffinePoint(Attestation.xPoint, Attestation.yPoint)
         pubkey = new JSUCrypt.key.EcFpPublicKey(256, domain, affinePoint)
         ecsig = new JSUCrypt.signature.ECDSA(sha)
         ecsig.init(pubkey, JSUCrypt.signature.MODE_VERIFY)
         if ecsig.verify(dataToSign, dataSigBytes)
+          @_attestation = Attestation
           d.resolve(this)
         else
           d.rejectWithError(Errors.DongleNotCertified)


  constructor: (card) ->
    super
    @_xpubs = _.clone(@_xpubs)
    @id = card.deviceId
    @deviceId = card.deviceId

        d.rejectWithError(Errors.CommunicationError, err)
      .done()
      d.promise

  getAttestation: -> @_attestation

  # Return asynchronously state. Wait until a state is set.
  # @param [Function] callback Optional argument
