use of org.jivesoftware.smackx.ox.element.SecretkeyElement in project Smack by igniterealtime.
the class SecretkeyElementTest method providerTest.
@Test
public void providerTest() throws Exception {
String expected = "<secretkey xmlns='urn:xmpp:openpgp:0'>" + "BASE64_OPENPGP_ENCRYPTED_SECRET_KEY" + "</secretkey>";
byte[] key = "BASE64_OPENPGP_ENCRYPTED_SECRET_KEY".getBytes(Charset.forName("UTF-8"));
SecretkeyElement element = new SecretkeyElement(key);
assertXmlSimilar(expected, element.toXML().toString());
XmlPullParser parser = TestUtils.getParser(expected);
SecretkeyElement parsed = SecretkeyElementProvider.TEST_INSTANCE.parse(parser);
assertArrayEquals(element.getB64Data(), parsed.getB64Data());
}
Aggregations