public int readUInt32AsInt() throws BufferException { return (int) readUInt32(); }
public long readUInt64() throws BufferException { long uint64 = (readUInt32() << 32) + (readUInt32() & 0xffffffffL); if (uint64 < 0) throw new BufferException("Cannot handle values > Long.MAX_VALUE"); return uint64; }
@SuppressWarnings("unchecked") static <T extends PublicKey> Certificate<T> readPubKey(Buffer<?> buf, KeyType innerKeyType) throws GeneralSecurityException { Certificate.Builder<T> builder = Certificate.getBuilder(); try { builder.nonce(buf.readBytes()); builder.publicKey((T) innerKeyType.readPubKeyFromBuffer(buf)); builder.serial(buf.readUInt64AsBigInteger()); builder.type(buf.readUInt32()); builder.id(buf.readString()); builder.validPrincipals(unpackList(buf.readBytes())); builder.validAfter(dateFromEpoch(buf.readUInt64())); builder.validBefore(dateFromEpoch(buf.readUInt64())); builder.critOptions(unpackMap(buf.readBytes())); builder.extensions(unpackMap(buf.readBytes())); buf.readString(); // reserved builder.signatureKey(buf.readBytes()); builder.signature(buf.readBytes()); } catch (Buffer.BufferException be) { throw new GeneralSecurityException(be); } return builder.build(); }
public int readUInt32AsInt() throws BufferException { return (int) readUInt32(); }
public int readUInt32AsInt() throws BufferException { return (int) readUInt32(); }
public long readUInt64() throws BufferException { long uint64 = (readUInt32() << 32) + (readUInt32() & 0xffffffffL); if (uint64 < 0) throw new BufferException("Cannot handle values > Long.MAX_VALUE"); return uint64; }
public long readUInt64() throws BufferException { long uint64 = (readUInt32() << 32) + (readUInt32() & 0xffffffffL); if (uint64 < 0) throw new BufferException("Cannot handle values > Long.MAX_VALUE"); return uint64; }
@SuppressWarnings("unchecked") static <T extends PublicKey> Certificate<T> readPubKey(Buffer<?> buf, KeyType innerKeyType) throws GeneralSecurityException { Certificate.Builder<T> builder = Certificate.getBuilder(); try { builder.nonce(buf.readBytes()); builder.publicKey((T) innerKeyType.readPubKeyFromBuffer(buf)); builder.serial(buf.readUInt64AsBigInteger()); builder.type(buf.readUInt32()); builder.id(buf.readString()); builder.validPrincipals(unpackList(buf.readBytes())); builder.validAfter(dateFromEpoch(buf.readUInt64())); builder.validBefore(dateFromEpoch(buf.readUInt64())); builder.critOptions(unpackMap(buf.readBytes())); builder.extensions(unpackMap(buf.readBytes())); buf.readString(); // reserved builder.signatureKey(buf.readBytes()); builder.signature(buf.readBytes()); } catch (Buffer.BufferException be) { throw new GeneralSecurityException(be); } return builder.build(); }