@@ -89,10 +89,11 @@ public class Builder {
8989 protected final Entry < byte []> immutable = ( Entry < byte []>) format .getHeader ().addEntry ( HEADERIMMUTABLE , 16 );
9090
9191 protected Contents contents = new Contents ();
92- protected File privateKeyRingFile ;
93- protected String privateKeyId ;
94- protected String privateKeyPassphrase ;
95- protected PGPPrivateKey privateKey ;
92+ protected File privateKeyRingFile ;
93+ protected String privateKeyId ;
94+ protected String privateKeyPassphrase ;
95+ protected PGPPrivateKey privateKey ;
96+ protected int signatureSize = 287 ;
9697
9798 /**
9899 * Initializes the builder and sets some required fields to known values.
@@ -1220,6 +1221,15 @@ public void setPrivateKeyPassphrase( String privateKeyPassphrase ) {
12201221 public void setPrivateKey ( PGPPrivateKey privateKey ) {
12211222 this .privateKey = privateKey ;
12221223 }
1224+
1225+ /**
1226+ * Sets the signature size for generating keys with different RSA headers.
1227+ * This should only be used if the exact size of the header is known.
1228+ * @param signatureSize the signature size
1229+ */
1230+ public void setSignatureSize ( int signatureSize ) {
1231+ this .signatureSize = signatureSize ;
1232+ }
12231233
12241234 /**
12251235 * Generates an RPM with a standard name consisting of the RPM package name, version, release,
@@ -1398,9 +1408,9 @@ public void build( final FileChannel original) throws NoSuchAlgorithmException,
13981408
13991409 protected SignatureGenerator createSignatureGenerator () {
14001410 if (privateKey != null ) {
1401- return new SignatureGenerator ( privateKey );
1411+ return new SignatureGenerator ( privateKey , signatureSize );
14021412 }
1403- return new SignatureGenerator ( privateKeyRingFile , privateKeyId , privateKeyPassphrase );
1413+ return new SignatureGenerator ( privateKeyRingFile , privateKeyId , privateKeyPassphrase , signatureSize );
14041414 }
14051415
14061416 protected byte [] getSignature ( final int count ) {
0 commit comments