Examples of PqAuthReq


Examples of decoder.commands.PqAuthReq

    @Test
    public void testDecode() throws Exception {
        HeaderMessageDecoder messageDecoder = new HeaderMessageDecoder();
        messageDecoder.setNonEncryptedDecoder(new ContentMessageDecoder());
        PqAuthReq auth = messageDecoder.decode(new ByteArrayInputStream(Hex.decodeHex(pqAuth.toCharArray())),
                PqAuthReq.class);
        byte[] nonceBytes = ((BigInteger) auth.getNonce()).toByteArray();
        ArrayUtils.reverse(nonceBytes); // reversed, coz it's decoded as number
        String nonceInHex = Hex.encodeHexString(nonceBytes);
        Assert.assertNotNull(auth.getNonce());
        Assert.assertEquals(nonce, nonceInHex);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.