din.on(false); Signature signature = new Signature(_sigType); signature.readBytes(in); int avail = in.available(); if (avail > 0)
public void readBytes(InputStream rawConfig) throws DataFormatException, IOException { _destination = Destination.create(rawConfig); _options = DataHelper.readProperties(rawConfig); _creationDate = DataHelper.readDate(rawConfig); _signature = new Signature(_destination.getSigningPublicKey().getType()); _signature.readBytes(rawConfig); }
Signature signature = new Signature(); signature.readBytes(fileInputStream);
/** * This does NOT validate the signature * * @throws IllegalStateException if called more than once or Destination already set */ @Override public void readBytes(InputStream in) throws DataFormatException, IOException { if (_signingKey != null) throw new IllegalStateException(); // LS2 header readHeader(in); // Encrypted LS2 part int encryptedSize = (int) DataHelper.readLong(in, 2); if (encryptedSize < MIN_ENCRYPTED_SIZE || encryptedSize > MAX_ENCRYPTED_SIZE) throw new DataFormatException("bad LS size: " + encryptedSize); _encryptedData = new byte[encryptedSize]; DataHelper.read(in, _encryptedData); // signature type depends on offline or not SigType type = isOffline() ? _transientSigningPublicKey.getType() : _signingKey.getType(); _signature = new Signature(type); _signature.readBytes(in); }
_signature.readBytes(in);
protected void readOfflineBytes(InputStream in) throws DataFormatException, IOException { _transientExpires = DataHelper.readLong(in, 4) * 1000; int itype = (int) DataHelper.readLong(in, 2); SigType type = SigType.getByCode(itype); if (type == null) throw new DataFormatException("Unknown sig type " + itype); _transientSigningPublicKey = new SigningPublicKey(type); _transientSigningPublicKey.readBytes(in); SigType stype = _destination.getSigningPublicKey().getType(); _offlineSignature = new Signature(stype); _offlineSignature.readBytes(in); }
rxSign = new Signature(type); rxSign.readBytes(dgStream);
_signature.readBytes(in);
_signature.readBytes(in);
/** * Overridden because we have a blinded key, not a dest */ @Override protected void readOfflineBytes(InputStream in) throws DataFormatException, IOException { _transientExpires = DataHelper.readLong(in, 4) * 1000; int itype = (int) DataHelper.readLong(in, 2); SigType type = SigType.getByCode(itype); if (type == null) throw new DataFormatException("Unknown sig type " + itype); _transientSigningPublicKey = new SigningPublicKey(type); _transientSigningPublicKey.readBytes(in); SigType stype = _signingKey.getType(); _offlineSignature = new Signature(stype); _offlineSignature.readBytes(in); }
_signature.readBytes(in);
_transientSigningPublicKey.readBytes(destKeyStream); _offlineSignature = new Signature(dtype); _offlineSignature.readBytes(destKeyStream);