### Question:
SESeal extends ASN1Object { public static SESeal getInstance(Object o) { if (o instanceof SESeal) { return (SESeal) o; } else if (o != null) { return new SESeal(ASN1Sequence.getInstance(o)); } return null; } SESeal();  SESeal(SES_SealInfo esealInfo, SES_SignInfo signInfo);  SESeal(ASN1Sequence seq); static SESeal getInstance(Object o); SES_SealInfo getEsealInfo(); SESeal setEsealInfo(SES_SealInfo esealInfo); SES_SignInfo getSignInfo(); SESeal setSignInfo(SES_SignInfo signInfo); @Override ASN1Primitive toASN1Primitive();  }### Answer:
@Test void sealBuild() throws Exception { Path userP12 = Paths.get("src/test/resources", "USER.p12"); Path sealerP12 = Paths.get("src/test/resources", "SealBuilder.p12"); Path picturePath = Paths.get("src/test/resources", "StampImg.png"); Path out = Paths.get("target/UserV1.esl"); SES_Header header = new SES_Header(new ASN1Integer(1), new DERIA5String("OFDR&WTest")); Certificate userCert = PKCS12Tools.ReadUserCert(userP12, "private", "777777"); ASN1EncodableVector v = new ASN1EncodableVector(1); v.add(new DEROctetString(userCert.getEncoded())); Calendar then = Calendar.getInstance(); then.add(Calendar.YEAR, 2); SES_ESPropertyInfo property = new SES_ESPropertyInfo() .setType(SES_ESPropertyInfo.OrgType) .setName(new DERUTF8String("OFDRW测试用印章")) .setCertList(new DERSequence(v)) .setCreateDate(new ASN1UTCTime(new Date())) .setValidStart(new ASN1UTCTime(new Date())) .setValidEnd(new ASN1UTCTime(then.getTime())); SES_ESPictrueInfo picture = new SES_ESPictrueInfo() .setType("PNG") .setData(Files.readAllBytes(picturePath)) .setWidth(40) .setHeight(40); SES_SealInfo sealInfo = new SES_SealInfo() .setHeader(header) .setEsID(UUID.randomUUID().toString().replace("-", "").toUpperCase()) .setProperty(property) .setPicture(picture); Certificate sealerCert = PKCS12Tools.ReadUserCert(sealerP12, "private", "777777"); PrivateKey privateKey = PKCS12Tools.ReadPrvKey(sealerP12, "private", "777777"); DEROctetString signCert = new DEROctetString(sealerCert.getEncoded()); v = new ASN1EncodableVector(3); v.add(sealInfo); v.add(signCert); v.add(GMObjectIdentifiers.sm2sign_with_sm3); Signature signature = Signature.getInstance("SM3withSm2", "BC"); signature.initSign(privateKey); signature.update(new DERSequence(v).getEncoded("DER")); byte[] sign = signature.sign(); SES_SignInfo signInfo = new SES_SignInfo() .setCert(signCert) .setSignatureAlgorithm(GMObjectIdentifiers.sm2sign_with_sm3) .setSignData(sign); SESeal seal = new SESeal(sealInfo, signInfo); Files.write(out, seal.getEncoded("DER")); }