Record Class SignatureInfo
java.lang.Object
java.lang.Record
cloud.opencode.base.pdf.signature.SignatureInfo
- Record Components:
name- signature name | 签名名称reason- signing reason | 签名原因location- signing location | 签名位置contactInfo- contact information | 联系信息signDate- signing date | 签名日期certificates- certificate chain | 证书链timestampInfo- timestamp info (if present) | 时间戳信息isValid- whether signature is valid | 签名是否有效coversWholeDoc- whether signature covers entire document | 签名是否覆盖整个文档revisionNumber- revision number | 修订号
public record SignatureInfo(String name, String reason, String location, String contactInfo, Instant signDate, List<X509Certificate> certificates, TimestampInfo timestampInfo, boolean isValid, boolean coversWholeDoc, int revisionNumber)
extends Record
Signature Information
签名信息
Contains details about a PDF digital signature.
包含 PDF 数字签名的详细信息。
Features | 主要功能:
- Signature metadata (name, reason, location, contact) - 签名元数据(名称、原因、位置、联系方式)
- Certificate chain access - 证书链访问
- Timestamp information - 时间戳信息
- Validity and coverage status - 有效性和覆盖状态
Usage Examples | 使用示例:
SignatureInfo info = SignatureInfo.builder()
.name("Contract")
.reason("Approval")
.valid(true)
.build();
String signer = info.getSignerName();
boolean hasTs = info.hasTimestamp();
Security | 安全性:
- Thread-safe: Yes — immutable record - 线程安全: 是 — 不可变记录
- Null-safe: Partial — fields may be null - 空值安全: 部分 — 字段可能为空
- Defensive copies: Certificate list is copied on construction - 防御性拷贝: 证书列表在构造时进行拷贝
- Since:
- JDK 25, opencode-base-pdf V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classSignature Info Builder 签名信息构建器 -
Constructor Summary
ConstructorsConstructorDescriptionSignatureInfo(String name, String reason, String location, String contactInfo, Instant signDate, List<X509Certificate> certificates, TimestampInfo timestampInfo, boolean isValid, boolean coversWholeDoc, int revisionNumber) Creates a new signature info. -
Method Summary
Modifier and TypeMethodDescriptionstatic SignatureInfo.Builderbuilder()Creates a builder for signature info.Returns the value of thecertificatesrecord component.Returns the value of thecontactInforecord component.booleanReturns the value of thecoversWholeDocrecord component.final booleanIndicates whether some other object is "equal to" this one.Gets the signer certificate.Gets signer name from certificate.final inthashCode()Returns a hash code value for this object.booleanChecks if signature has timestamp.booleanisValid()Returns the value of theisValidrecord component.location()Returns the value of thelocationrecord component.name()Returns the value of thenamerecord component.reason()Returns the value of thereasonrecord component.intReturns the value of therevisionNumberrecord component.signDate()Returns the value of thesignDaterecord component.Returns the value of thetimestampInforecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
SignatureInfo
public SignatureInfo(String name, String reason, String location, String contactInfo, Instant signDate, List<X509Certificate> certificates, TimestampInfo timestampInfo, boolean isValid, boolean coversWholeDoc, int revisionNumber) Creates a new signature info. 创建新的签名信息。
-
-
Method Details
-
getSignerCertificate
Gets the signer certificate. 获取签名者证书。- Returns:
- signer certificate, or null if none | 签名者证书,如果没有则返回 null
-
getSignerName
Gets signer name from certificate. 从证书获取签名者名称。- Returns:
- signer name | 签名者名称
-
hasTimestamp
public boolean hasTimestamp()Checks if signature has timestamp. 检查签名是否有时间戳。- Returns:
- true if has timestamp | 如果有时间戳返回 true
-
builder
Creates a builder for signature info. 创建签名信息构建器。- Returns:
- signature info builder | 签名信息构建器
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
name
-
reason
-
location
-
contactInfo
Returns the value of thecontactInforecord component.- Returns:
- the value of the
contactInforecord component
-
signDate
-
certificates
Returns the value of thecertificatesrecord component.- Returns:
- the value of the
certificatesrecord component
-
timestampInfo
Returns the value of thetimestampInforecord component.- Returns:
- the value of the
timestampInforecord component
-
isValid
-
coversWholeDoc
public boolean coversWholeDoc()Returns the value of thecoversWholeDocrecord component.- Returns:
- the value of the
coversWholeDocrecord component
-
revisionNumber
public int revisionNumber()Returns the value of therevisionNumberrecord component.- Returns:
- the value of the
revisionNumberrecord component
-