public final class AOFacturaESigner
extends java.lang.Object
implements es.gob.afirma.core.signers.AOSigner
Constructor and Description |
---|
AOFacturaESigner() |
Modifier and Type | Method and Description |
---|---|
byte[] |
cosign(byte[] data,
byte[] sign,
java.lang.String algorithm,
java.security.PrivateKey key,
java.security.cert.Certificate[] certChain,
java.util.Properties extraParams)
Operación no soportada.
|
byte[] |
cosign(byte[] sign,
java.lang.String algorithm,
java.security.PrivateKey key,
java.security.cert.Certificate[] certChain,
java.util.Properties extraParams)
Operación no soportada.
|
byte[] |
countersign(byte[] sign,
java.lang.String algorithm,
es.gob.afirma.core.signers.CounterSignTarget targetType,
java.lang.Object[] targets,
java.security.PrivateKey key,
java.security.cert.Certificate[] certChain,
java.util.Properties extraParams)
Operación no soportada, se lanza una
UnsupportedOperationException . |
byte[] |
getData(byte[] signData) |
static java.util.Properties |
getFacturaEExtraParams(java.util.Properties originalExtraParams)
Obtiene los parámetros adicionales necesarios para generar una firma XAdES compatible con FacturaE,
combinándolo con los parámetros proporcionados.
|
java.lang.String |
getSignedName(java.lang.String originalName,
java.lang.String inText) |
es.gob.afirma.core.util.tree.AOTreeModel |
getSignersStructure(byte[] sign,
boolean asSimpleSignInfo) |
es.gob.afirma.core.signers.AOSignInfo |
getSignInfo(byte[] signData) |
boolean |
isSign(byte[] is) |
boolean |
isValidDataFile(byte[] is)
Indica si los datos son una factura electrónica.
|
byte[] |
sign(byte[] data,
java.lang.String algorithm,
java.security.PrivateKey key,
java.security.cert.Certificate[] certChain,
java.util.Properties extraParams)
Firma Facturas en formato XAdES Factura-E.
|
public byte[] sign(byte[] data, java.lang.String algorithm, java.security.PrivateKey key, java.security.cert.Certificate[] certChain, java.util.Properties extraParams) throws es.gob.afirma.core.AOException, java.io.IOException
sign
in interface es.gob.afirma.core.signers.AOSimpleSigner
data
- Factura electrónica.algorithm
- Algoritmo a usar para la firma.
Se aceptan los siguientes algoritmos en el parámetro algorithm
:
key
- Clave privada a usar para firmar.certChain
- Cadena de certificados del firmanteextraParams
- Parámetros adicionales para la firma.
Se aceptan los siguientes valores en el parámetro xParams
:
InvalidEFacturaDataException
- Cuando se proporcionan datos que no son una factura electrónicaEFacturaAlreadySignedException
- Cuando se proporciona un factura ya firmadaes.gob.afirma.core.AOException
- Cuando ocurre cualquier problema durante el procesojava.io.IOException
- Cuando ocurren problemas relacionados con la lectura de los datospublic byte[] cosign(byte[] data, byte[] sign, java.lang.String algorithm, java.security.PrivateKey key, java.security.cert.Certificate[] certChain, java.util.Properties extraParams)
cosign
in interface es.gob.afirma.core.signers.AOCoSigner
public byte[] cosign(byte[] sign, java.lang.String algorithm, java.security.PrivateKey key, java.security.cert.Certificate[] certChain, java.util.Properties extraParams)
cosign
in interface es.gob.afirma.core.signers.AOCoSigner
public byte[] countersign(byte[] sign, java.lang.String algorithm, es.gob.afirma.core.signers.CounterSignTarget targetType, java.lang.Object[] targets, java.security.PrivateKey key, java.security.cert.Certificate[] certChain, java.util.Properties extraParams)
UnsupportedOperationException
.countersign
in interface es.gob.afirma.core.signers.AOCounterSigner
public static java.util.Properties getFacturaEExtraParams(java.util.Properties originalExtraParams)
originalExtraParams
- Parámetros proporcionados originalmente.public es.gob.afirma.core.util.tree.AOTreeModel getSignersStructure(byte[] sign, boolean asSimpleSignInfo) throws es.gob.afirma.core.AOInvalidFormatException, java.io.IOException
getSignersStructure
in interface es.gob.afirma.core.signers.AOSigner
es.gob.afirma.core.AOInvalidFormatException
java.io.IOException
public boolean isSign(byte[] is) throws java.io.IOException
isSign
in interface es.gob.afirma.core.signers.AOSigner
java.io.IOException
public boolean isValidDataFile(byte[] is)
isValidDataFile
in interface es.gob.afirma.core.signers.AOSigner
is
- Datos a comprobartrue
si los datos son una factura electrónica,
false
en caso contrariopublic java.lang.String getSignedName(java.lang.String originalName, java.lang.String inText)
getSignedName
in interface es.gob.afirma.core.signers.AOSigner
public byte[] getData(byte[] signData) throws es.gob.afirma.core.AOException, java.io.IOException
getData
in interface es.gob.afirma.core.signers.AOSigner
es.gob.afirma.core.AOException
java.io.IOException
public es.gob.afirma.core.signers.AOSignInfo getSignInfo(byte[] signData)
getSignInfo
in interface es.gob.afirma.core.signers.AOSigner