src/PowerAuth/protocol/PrivateTypes.cpp
// WARNING: If you update PD_VERSION, then please update also routine
//          located in PA2SessionStatusDataReader.m in iOS extensions project.
If you update PD_VERSION, then please update also routine
located in PA2SessionStatusDataReader.m in iOS extensions project.
If you update PD_VERSION then please update also routine located in PA2SessionStatusDataReader . m in iOS extensions project .
bool SerializePersistentData(const PersistentData & pd, utils::DataWriter & writer)
	{
		CC7_ASSERT(ValidatePersistentData(pd), "Invalid persistent data");
		writer.openVersion(PD_TAG, pd.isV3() ? PD_VERSION_V5 : PD_VERSION_V2);
		if (pd.isV3()) {
			writer.writeData(pd.signatureCounterData);
		} else {
			writer.writeU64	(pd.signatureCounter);
		}
		writer.writeString	(pd.activationId);
		writer.writeU32		(pd.passwordIterations);
		writer.writeData	(pd.passwordSalt);
		writer.writeData	(pd.sk.possessionKey);
		writer.writeData	(pd.sk.knowledgeKey);
		writer.writeData	(pd.sk.biometryKey);
		writer.writeData	(pd.sk.transportKey);
		writer.writeData	(pd.serverPublicKey);
		writer.writeData	(pd.devicePublicKey);
		writer.writeData	(pd.cDevicePrivateKey);
		writer.writeU32		(pd.flagsU32);
		writer.writeData	(pd.cRecoveryData);
		writer.writeByte	(pd.signatureCounterByte);
		writer.closeVersion();
		return true;
	}
bool SerializePersistentData ( const PersistentData & pd , utils :: DataWriter & writer ) { CC7_ASSERT ( ValidatePersistentData ( pd ) , " " ) ; writer . openVersion ( PD_TAG , pd . isV3 ( ) ? PD_VERSION_V5 : PD_VERSION_V2 ) ; if ( pd . isV3 ( ) ) { writer . writeData ( pd . signatureCounterData ) ; } else { writer . writeU64 ( pd . signatureCounter ) ; } writer . writeString ( pd . activationId ) ; writer . writeU32 ( pd . passwordIterations ) ; writer . writeData ( pd . passwordSalt ) ; writer . writeData ( pd . sk . possessionKey ) ; writer . writeData ( pd . sk . knowledgeKey ) ; writer . writeData ( pd . sk . biometryKey ) ; writer . writeData ( pd . sk . transportKey ) ; writer . writeData ( pd . serverPublicKey ) ; writer . writeData ( pd . devicePublicKey ) ; writer . writeData ( pd . cDevicePrivateKey ) ; writer . writeU32 ( pd . flagsU32 ) ; writer . writeData ( pd . cRecoveryData ) ; writer . writeByte ( pd . signatureCounterByte ) ; writer . closeVersion ( ) ; return true ; }
WARNING: If you update PD_VERSION, then please update also routine
located in PA2SessionStatusDataReader.m in iOS extensions project.
WARNING : If you update PD_VERSION then please update also routine located in PA2SessionStatusDataReader . m in iOS extensions project .
// Serialize hash data or counter, depending on data version // write signature keys // write public keys // encrypted private key // flags // encrypted recovery data (PD v4) // Counter byte (PD v5)