diff --git a/jsign-core/src/main/java/net/jsign/AuthenticodeSigner.java b/jsign-core/src/main/java/net/jsign/AuthenticodeSigner.java index 9b124f3e..f29401e6 100644 --- a/jsign-core/src/main/java/net/jsign/AuthenticodeSigner.java +++ b/jsign-core/src/main/java/net/jsign/AuthenticodeSigner.java @@ -507,8 +507,10 @@ private AttributeTable createAuthenticatedAttributes() { SpcStatementType spcStatementType = new SpcStatementType(AuthenticodeObjectIdentifiers.SPC_INDIVIDUAL_SP_KEY_PURPOSE_OBJID); attributes.add(new Attribute(AuthenticodeObjectIdentifiers.SPC_STATEMENT_TYPE_OBJID, new DERSet(spcStatementType))); - SpcSpOpusInfo spcSpOpusInfo = new SpcSpOpusInfo(programName, programURL); - attributes.add(new Attribute(AuthenticodeObjectIdentifiers.SPC_SP_OPUS_INFO_OBJID, new DERSet(spcSpOpusInfo))); + if (programName != null || programURL != null) { + SpcSpOpusInfo spcSpOpusInfo = new SpcSpOpusInfo(programName, programURL); + attributes.add(new Attribute(AuthenticodeObjectIdentifiers.SPC_SP_OPUS_INFO_OBJID, new DERSet(spcSpOpusInfo))); + } return new AttributeTable(new DERSet(attributes.toArray(new ASN1Encodable[0]))); }