本文整理汇总了Java中co.nstant.in.cbor.CborBuilder类的典型用法代码示例。如果您正苦于以下问题:Java CborBuilder类的具体用法?Java CborBuilder怎么用?Java CborBuilder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CborBuilder类属于co.nstant.in.cbor包,在下文中一共展示了CborBuilder类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: encode
import co.nstant.in.cbor.CborBuilder; //导入依赖的package包/类
@Override
public byte[] encode() throws CborException {
ByteArrayOutputStream output = new ByteArrayOutputStream();
List<DataItem> dataItems =
new CborBuilder().addMap().put(new UnsignedInteger(KTY_LABEL), new UnsignedInteger(kty))
.put(new UnsignedInteger(ALG_LABEL), new NegativeInteger(alg.encodeToInt()))
.put(new NegativeInteger(N_LABEL), new ByteString(n))
.put(new NegativeInteger(E_LABEL), new ByteString(e)).end().build();
new CborEncoder(output).encode(dataItems);
return output.toByteArray();
}
示例2: encode
import co.nstant.in.cbor.CborBuilder; //导入依赖的package包/类
@Override
public byte[] encode() throws CborException {
ByteArrayOutputStream output = new ByteArrayOutputStream();
List<DataItem> dataItems =
new CborBuilder().addMap().put(new UnsignedInteger(KTY_LABEL), new UnsignedInteger(kty))
.put(new UnsignedInteger(ALG_LABEL), new NegativeInteger(alg.encodeToInt()))
.put(new NegativeInteger(CRV_LABEL), new UnsignedInteger(crv))
.put(new NegativeInteger(X_LABEL), new ByteString(x))
.put(new NegativeInteger(Y_LABEL), new ByteString(y)).end().build();
new CborEncoder(output).encode(dataItems);
return output.toByteArray();
}
示例3: encode
import co.nstant.in.cbor.CborBuilder; //导入依赖的package包/类
/**
* @return Encoded byte array containing AttestationObject data
* @throws CborException
*/
public byte[] encode() throws CborException {
ByteArrayOutputStream output = new ByteArrayOutputStream();
List<DataItem> cbor =
new CborBuilder().addMap().put("fmt", fmt).put("authData", authData.encode())
.put(new UnicodeString("attStmt"), attStmt.encode()).end().build();
new CborEncoder(output).encode(cbor);
return output.toByteArray();
}