Package br.ufsc.labsec.signature
Class FileToBeSignedGenerator
java.lang.Object
br.ufsc.labsec.signature.FileToBeSignedGenerator
public class FileToBeSignedGenerator extends Object
-
Field Summary
Fields Modifier and Type Field Description static String
CADES_INFORMATION_CONTENT_TYPE
static String
CADES_INFORMATION_SIGNER_LOCATION_CITY
static String
CADES_INFORMATION_SIGNER_LOCATION_COUNTRY_NAME
static String
CADES_INFORMATION_SIGNER_LOCATION_POSTAL_CODE
static String
CADES_INFORMATION_SIGNER_LOCATION_STATE_OR_PROVINCE
static String
PADES_INFORMATION_REASON
static String
XADES_INFORMATION_PRODUCTION_PLACE_CITY
static String
XADES_INFORMATION_PRODUCTION_PLACE_COUNTRY_NAME
static String
XADES_INFORMATION_PRODUCTION_PLACE_POSTAL_CODE
static String
XADES_INFORMATION_PRODUCTION_PLACE_STATE_OR_PROVINCE
static String
XADES_INFORMATION_SIGNED_DATA_DESCRIPTION
static String
XADES_INFORMATION_SIGNED_DATA_ENCODING
static String
XADES_INFORMATION_SIGNED_DATA_TYPE
-
Constructor Summary
Constructors Constructor Description FileToBeSignedGenerator()
-
Method Summary
Modifier and Type Method Description <T extends ExtraInformation>
FileToBeSigned<T>createDetachedFileToBeSigned(Application application, FileToBeSigned<T> fileToBeSigned, InputStream inputStream)
ExtraInformation
generateExtraInformation(SignerType signatureType, FileFormat fileFormat, byte[] contentToSign, SignerParameters parameters, String filename)
<T extends ExtraInformation>
FileToBeSigned<? extends T>generateFileToBeSigned(Application application, String filename, InputStream contentToBeSigned, FileFormat signatureFormat, SignerType signatureType, String signatureSuite, KeyStoreInformation keyStoreInformation, T extraInformation)
<T extends ExtraInformation>
FileToBeSigned<? extends T>generateFileToBeSigned(Application application, String filename, InputStream contentToBeSigned, FileFormat signatureFormat, SignerType signatureType, String signatureSuite, KeyStoreInformation keyStoreInformation, T extraInformation, List<String> signedAttributes, List<String> unsignedAttributes)
<T extends ExtraInformation>
FileToBeSigned<? extends T>generateFileToBeSigned(Application application, URI uri, String fileExtension, FileFormat signatureFormat, SignerType signatureType, String signatureSuite, KeyStoreInformation keyStoreInformation, T extraInformation)
<T extends ExtraInformation>
FileToBeSigned<? extends T>generateFileToBeSigned(Application application, URI uri, String fileExtension, FileFormat signatureFormat, SignerType signatureType, String signatureSuite, KeyStoreInformation keyStoreInformation, T extraInformation, List<String> signedAttributes, List<String> unsignedAttributes)
<Encod, Sig extends Signature<Encod>>
FileToBeSigned<TSInformation<Encod,Sig>>generateTimestampToBeSigned(TimeStampComponent component, String attributeOid, byte[] digestToSign, String signatureSuite, Sig stampedSignature)
static void
selectAttributeCertificates(Application application, FileToBeSigned<?> fileToBeSigned, SignerParameters parameters)
static void
selectAttributeCertificates(Application application, FileToBeSigned<?> fileToBeSigned, List<byte[]> encodedCertificates)
-
Field Details
-
XADES_INFORMATION_PRODUCTION_PLACE_CITY
- See Also:
- Constant Field Values
-
XADES_INFORMATION_PRODUCTION_PLACE_STATE_OR_PROVINCE
- See Also:
- Constant Field Values
-
XADES_INFORMATION_PRODUCTION_PLACE_POSTAL_CODE
- See Also:
- Constant Field Values
-
XADES_INFORMATION_PRODUCTION_PLACE_COUNTRY_NAME
- See Also:
- Constant Field Values
-
XADES_INFORMATION_SIGNED_DATA_DESCRIPTION
- See Also:
- Constant Field Values
-
XADES_INFORMATION_SIGNED_DATA_ENCODING
- See Also:
- Constant Field Values
-
XADES_INFORMATION_SIGNED_DATA_TYPE
- See Also:
- Constant Field Values
-
PADES_INFORMATION_REASON
- See Also:
- Constant Field Values
-
CADES_INFORMATION_CONTENT_TYPE
- See Also:
- Constant Field Values
-
CADES_INFORMATION_SIGNER_LOCATION_CITY
- See Also:
- Constant Field Values
-
CADES_INFORMATION_SIGNER_LOCATION_STATE_OR_PROVINCE
- See Also:
- Constant Field Values
-
CADES_INFORMATION_SIGNER_LOCATION_POSTAL_CODE
- See Also:
- Constant Field Values
-
CADES_INFORMATION_SIGNER_LOCATION_COUNTRY_NAME
- See Also:
- Constant Field Values
-
-
Constructor Details
-
FileToBeSignedGenerator
public FileToBeSignedGenerator()
-
-
Method Details
-
generateExtraInformation
public ExtraInformation generateExtraInformation(SignerType signatureType, FileFormat fileFormat, byte[] contentToSign, SignerParameters parameters, String filename) throws ParserConfigurationException, IOException, SAXException, XPathExpressionException -
generateFileToBeSigned
public <T extends ExtraInformation> FileToBeSigned<? extends T> generateFileToBeSigned(Application application, URI uri, String fileExtension, FileFormat signatureFormat, SignerType signatureType, String signatureSuite, KeyStoreInformation keyStoreInformation, T extraInformation) throws IOException, PolicyException- Throws:
IOException
PolicyException
-
generateFileToBeSigned
public <T extends ExtraInformation> FileToBeSigned<? extends T> generateFileToBeSigned(Application application, URI uri, String fileExtension, FileFormat signatureFormat, SignerType signatureType, String signatureSuite, KeyStoreInformation keyStoreInformation, T extraInformation, List<String> signedAttributes, List<String> unsignedAttributes) throws IOException, PolicyException- Throws:
IOException
PolicyException
-
generateFileToBeSigned
public <T extends ExtraInformation> FileToBeSigned<? extends T> generateFileToBeSigned(Application application, String filename, InputStream contentToBeSigned, FileFormat signatureFormat, SignerType signatureType, String signatureSuite, KeyStoreInformation keyStoreInformation, T extraInformation) throws PolicyException, IOException- Throws:
PolicyException
IOException
-
generateFileToBeSigned
public <T extends ExtraInformation> FileToBeSigned<? extends T> generateFileToBeSigned(Application application, String filename, InputStream contentToBeSigned, FileFormat signatureFormat, SignerType signatureType, String signatureSuite, KeyStoreInformation keyStoreInformation, T extraInformation, List<String> signedAttributes, List<String> unsignedAttributes) throws PolicyException, IOException- Throws:
PolicyException
IOException
-
selectAttributeCertificates
public static void selectAttributeCertificates(Application application, FileToBeSigned<?> fileToBeSigned, SignerParameters parameters) throws IOException- Throws:
IOException
-
selectAttributeCertificates
public static void selectAttributeCertificates(Application application, FileToBeSigned<?> fileToBeSigned, List<byte[]> encodedCertificates) throws IOException- Throws:
IOException
-
generateTimestampToBeSigned
public <Encod, Sig extends Signature<Encod>> FileToBeSigned<TSInformation<Encod,Sig>> generateTimestampToBeSigned(TimeStampComponent component, String attributeOid, byte[] digestToSign, String signatureSuite, Sig stampedSignature) throws TimeStampException, PolicyException, IOException -
createDetachedFileToBeSigned
public <T extends ExtraInformation> FileToBeSigned<T> createDetachedFileToBeSigned(Application application, FileToBeSigned<T> fileToBeSigned, InputStream inputStream) throws PolicyException, IOException- Throws:
PolicyException
IOException
-