OSCoreCtx { public byte[] getRecipientKey() { return recipient_key; } OSCoreCtx(byte[] master_secret, boolean client);  OSCoreCtx(byte[] master_secret, boolean client, AlgorithmID alg, byte[] sender_id, byte[] recipient_id,
			AlgorithmID kdf, Integer replay_size, byte[] master_salt, byte[] contextId); @Override int hashCode(); @Override boolean equals(Object o); byte[] getSenderKey(); byte[] getRecipientKey(); AlgorithmID getAlg(); synchronized int getSenderSeq(); synchronized int getReceiverSeq(); byte[] getLastBlockTag(); byte[] getSenderId(); byte[] getRecipientId(); byte[] getCommonIV(); int getIVLength(); int getRecipientReplaySize(); int getRecipientReplayWindow(); byte[] getMasterSecret(); byte[] getSalt(); AlgorithmID getKdf(); byte[] getIdContext(); byte[] getMessageIdContext(); boolean getIncludeContextId(); void setIncludeContextId(boolean includeContextId); void setIncludeContextId(byte[] overrideContextId); boolean getResponsesIncludePartialIV(); void setResponsesIncludePartialIV(boolean responsesIncludePartialIV); boolean getContextRederivationEnabled(); void setContextRederivationEnabled(boolean contextRederivationEnabled); int getMaxUnfragmentedSize(); void setMaxUnfragmentedSize(int maxUnfragmentedSize); String getContextIdString(); String getSenderIdString(); String getRecipientIdString(); int rollbackRecipientSeq(); int rollbackRecipientReplay(); synchronized void setSenderSeq(int seq); synchronized void setReceiverSeq(int seq); void setLastBlockTag(byte[] tag); void setSenderKey(byte[] senderKey); void setRecipientKey(byte[] recipientKey); void setSeqMax(int seqMax); String getUri(); ContextRederivation.PHASE getContextRederivationPhase(); void setContextRederivationPhase(ContextRederivation.PHASE contextRederivationPhase); synchronized void increaseSenderSeq(); synchronized void checkIncomingSeq(int seq); synchronized void rollBack(); Code getCoAPCode(); void setCoAPCode(Code coapCode);  }
@Test public void testRecipientKey() throws OSException { OSCoreCtx ctx = new OSCoreCtx(master_secret, true, cipher, sid2, rid, kdf, 32, null, null); byte[] predictedRecipientKey = { (byte) 0xe5, 0x7b, 0x56, 0x35, (byte) 0x81, 0x51, 0x77, (byte) 0xcd, 0x67, (byte) 0x9a, (byte) 0xb4, (byte) 0xbc, (byte) 0xec, (byte) 0x9d, 0x7d, (byte) 0xda }; assertArrayEquals(predictedRecipientKey, ctx.getRecipientKey()); ctx = new OSCoreCtx(master_secret, true, cipher, sid, rid, kdf, 32, master_salt, null); byte[] predictedRecipientKeySalt = { (byte) 0xff, (byte) 0xb1, 0x4e, 0x09, 0x3c, (byte) 0x94, (byte) 0xc9, (byte) 0xca, (byte) 0xc9, 0x47, 0x16, 0x48, (byte) 0xb4, (byte) 0xf9, (byte) 0x87, 0x10 }; assertArrayEquals(predictedRecipientKeySalt, ctx.getRecipientKey()); ctx = new OSCoreCtx(master_secret, true, cipher, sid, rid, kdf, 32, master_salt, context_id); byte[] predictedRecipientKeyContextID = { (byte) 0xe3, (byte) 0x9a, 0x0c, 0x7c, 0x77, (byte) 0xb4, 0x3f, 0x03, (byte) 0xb4, (byte) 0xb3, (byte) 0x9a, (byte) 0xb9, (byte) 0xa2, 0x68, 0x69, (byte) 0x9f }; assertArrayEquals(predictedRecipientKeyContextID, ctx.getRecipientKey()); }