📄 signaturepacket.java
字号:
package au.net.aba.pgp;
/*
* $Id: SignaturePacket.java,v 1.2 1998/10/19 06:32:42 leachbj Exp $
* $Author: leachbj $
*
* Copyright (C) 1996-1998 Australian Business Access Pty Ltd.
* All rights reserved.
*
* Use, modification, copying and distribution of this software is subject the
* terms and conditions of the ABA Public Licence. See the file
* "PUBLIC_LICENCE" for additional information.
*
* If you have not received a copy of the Public Licence, you must destroy all
* copies of this file immediately.
*
* $Source: /aba/CVSROOT/jdk1.1/src/au.net.aba/pgp/SignaturePacket.java,v $
* $Revision: 1.2 $
* $Date: 1998/10/19 06:32:42 $
* $State: Exp $
*/
import java.io.*;
//
// Signature packet.
//
class SignaturePacket extends Packet
{
public final static String ident = "$Id: SignaturePacket.java,v 1.2 1998/10/19 06:32:42 leachbj Exp $";
public byte version; // PGP version
public byte mdLength; // bytes following to include in digest
public byte classification; // signature classifiction
public long timestamp; // timestamp of digest
public long id; // key id
public byte pkAlgorithm; // algorithm for public key scheme
public byte mdAlgorithm; // algorithm for message digest scheme
public byte[] mdCheck; // first two bytes of digest
public Multiprecision signature; // signature
//
// Construct from an input stream.
//
public SignaturePacket (InputStream input)
throws IOException
{
// build packet input stream
DataInputStream data = buildCipherPacketInputStream (
input,(byte)0x02,"signature packet expected");
version = data.readByte ();
mdLength = data.readByte ();
classification = data.readByte ();
timestamp = data.readUnsignedShort () << 16;
timestamp |= data.readUnsignedShort ();
id = data.readLong ();
pkAlgorithm = data.readByte ();
mdAlgorithm = data.readByte ();
mdCheck = new byte[2];
data.readFully (mdCheck);
signature = new Multiprecision (data);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -