Class PadesSigner
java.lang.Object
br.ufsc.labsec.signature.signer.signatureSwitch.SignatureDataWrapperGenerator
br.ufsc.labsec.signature.conformanceVerifier.pades.PadesSigner
- All Implemented Interfaces:
Signer<PadesInformation>
public class PadesSigner extends SignatureDataWrapperGenerator implements Signer<PadesInformation>
Esta classe cria uma assinatura PAdES em um documento.
Implementa
Signer
.-
Field Summary
-
Constructor Summary
Constructors Constructor Description PadesSigner(PadesSignatureComponent component)
Construtor -
Method Summary
Modifier and Type Method Description PadesSignatureComponent
getComponent()
Retorna o componente de assinatura PAdESbyte[]
getEncoded(org.apache.pdfbox.pdmodel.PDDocument document)
List<String>
getPoliciesAvailable()
Retorna a lista de políticas de assinatura disponiveisSignatureDataWrapper
getSignature(FileToBeSigned<? extends PadesInformation> fileToBeSigned)
InputStream
getSignatureStream()
Retorna o arquivo assinadoList<String>
getSignedAttributesAvailable(boolean advanced)
Retorna a lista de atributos assinados da assinaturaByteArrayOutputStream
getStream(org.apache.pdfbox.pdmodel.PDDocument document)
List<String>
getUnsignedAttributesAvailable(boolean advanced)
Retorna a lista de atributos não assinados da assinaturaboolean
sign(FileToBeSigned<? extends PadesInformation> fileToBeSigned)
Realiza a assinaturaboolean
supports(FileToBeSigned<? extends PadesInformation> fileToBeSigned)
Verifica se o documento requisitado pode ser assinado
-
Field Details
-
FILTER
- See Also:
- Constant Field Values
-
SUBFILTER
- See Also:
- Constant Field Values
-
CMS_LENGHT
public static final int CMS_LENGHT- See Also:
- Constant Field Values
-
TYPE
- See Also:
- Constant Field Values
-
SUB_FILTER
- See Also:
- Constant Field Values
-
CONTENTS
- See Also:
- Constant Field Values
-
-
Constructor Details
-
PadesSigner
Construtor- Parameters:
component
- Componente de assinatura PAdES
-
-
Method Details
-
sign
public boolean sign(FileToBeSigned<? extends PadesInformation> fileToBeSigned) throws SignerExceptionRealiza a assinatura- Specified by:
sign
in interfaceSigner<PadesInformation>
- Returns:
- Throws:
SignerException
-
getStream
public ByteArrayOutputStream getStream(org.apache.pdfbox.pdmodel.PDDocument document) throws IOException- Throws:
IOException
-
getEncoded
- Throws:
IOException
-
getSignatureStream
Retorna o arquivo assinado- Specified by:
getSignatureStream
in interfaceSigner<PadesInformation>
- Returns:
- O
InputStream
do arquivo assinado
-
getSignedAttributesAvailable
Retorna a lista de atributos assinados da assinatura- Specified by:
getSignedAttributesAvailable
in interfaceSigner<PadesInformation>
- Returns:
- A lista de atributos assinados da assinatura
-
getUnsignedAttributesAvailable
Retorna a lista de atributos não assinados da assinatura- Specified by:
getUnsignedAttributesAvailable
in interfaceSigner<PadesInformation>
- Returns:
- A lista de atributos não assinados da assinatura
-
getPoliciesAvailable
Retorna a lista de políticas de assinatura disponiveis- Specified by:
getPoliciesAvailable
in interfaceSigner<PadesInformation>
- Returns:
- A lista de políticas de assinatura
-
supports
public boolean supports(FileToBeSigned<? extends PadesInformation> fileToBeSigned) throws SignerException, CertificationPathExceptionVerifica se o documento requisitado pode ser assinado- Specified by:
supports
in interfaceSigner<PadesInformation>
- Parameters:
fileToBeSigned
- documento a ser assinado- Throws:
SignerException
CertificationPathException
-
getComponent
Retorna o componente de assinatura PAdES- Returns:
- O componente de assinatura PAdES
-
getSignature
public SignatureDataWrapper getSignature(FileToBeSigned<? extends PadesInformation> fileToBeSigned) throws SignerException- Specified by:
getSignature
in interfaceSigner<PadesInformation>
- Throws:
SignerException
-