public class MessageValidator extends Object
TODO: Rozhrání a implementace této třídy přejde předělat, nyní slouží pouze za účelem testování. Implementace je neefektivní.
| Constructor and Description |
|---|
MessageValidator() |
MessageValidator(cz.abclinuxu.datoveschranky.common.Config config) |
| Modifier and Type | Method and Description |
|---|---|
static cz.abclinuxu.datoveschranky.common.entities.DeliveryInfo |
buildDeliveryInfo(cz.abclinuxu.datoveschranky.common.entities.MessageEnvelope env,
cz.abclinuxu.datoveschranky.ws.dm.TDelivery delivery) |
static cz.abclinuxu.datoveschranky.common.entities.DeliveryInfo |
buildDeliveryInfo(cz.abclinuxu.datoveschranky.ws.dm.TDelivery delivery) |
protected cz.abclinuxu.datoveschranky.common.entities.Message |
buildMessage(cz.abclinuxu.datoveschranky.common.entities.MessageEnvelope envelope,
cz.abclinuxu.datoveschranky.ws.dm.TReturnedMessage message,
cz.abclinuxu.datoveschranky.common.interfaces.AttachmentStorer storer) |
cz.abclinuxu.datoveschranky.common.entities.DeliveryInfo |
createDeliveryInfo(byte[] asPCKS7) |
cz.abclinuxu.datoveschranky.common.entities.Message |
createMessage(byte[] content,
cz.abclinuxu.datoveschranky.common.interfaces.AttachmentStorer storer) |
cz.abclinuxu.datoveschranky.common.entities.Message |
createMessage(cz.abclinuxu.datoveschranky.common.entities.content.Content content,
cz.abclinuxu.datoveschranky.common.interfaces.AttachmentStorer storer) |
cz.abclinuxu.datoveschranky.common.entities.Message |
readZFO(byte[] input,
cz.abclinuxu.datoveschranky.common.interfaces.AttachmentStorer storer) |
protected static byte[] |
toByteArray(Element element) |
cz.abclinuxu.datoveschranky.common.entities.Message |
validateAndCreateMessage(byte[] asPKCS7,
cz.abclinuxu.datoveschranky.common.interfaces.AttachmentStorer storer,
boolean checkHash)
Na vstup dostane podepsanou zprávu v binárním formátu PKCS#7 (žádné XML),
a vrátí zprávu včetně příloh při splnění následujících podmínek:
|
cz.abclinuxu.datoveschranky.common.entities.Message |
validateAndCreateMessage(cz.abclinuxu.datoveschranky.common.entities.content.Content content,
cz.abclinuxu.datoveschranky.common.interfaces.AttachmentStorer storer)
Wrapper nad metodou
validateAndCreateMessage(byte[], AttachmentStorer, boolean). |
public MessageValidator()
public MessageValidator(cz.abclinuxu.datoveschranky.common.Config config)
public cz.abclinuxu.datoveschranky.common.entities.Message validateAndCreateMessage(cz.abclinuxu.datoveschranky.common.entities.content.Content content,
cz.abclinuxu.datoveschranky.common.interfaces.AttachmentStorer storer)
throws IOException
validateAndCreateMessage(byte[], AttachmentStorer, boolean).content - PKCS podepsany obsahstorer - uloziste pro prilohyIOExceptionpublic cz.abclinuxu.datoveschranky.common.entities.Message createMessage(cz.abclinuxu.datoveschranky.common.entities.content.Content content,
cz.abclinuxu.datoveschranky.common.interfaces.AttachmentStorer storer)
throws IOException
IOExceptionpublic cz.abclinuxu.datoveschranky.common.entities.Message createMessage(byte[] content,
cz.abclinuxu.datoveschranky.common.interfaces.AttachmentStorer storer)
throws IOException
IOExceptionpublic cz.abclinuxu.datoveschranky.common.entities.Message validateAndCreateMessage(byte[] asPKCS7,
cz.abclinuxu.datoveschranky.common.interfaces.AttachmentStorer storer,
boolean checkHash)
throws cz.abclinuxu.datoveschranky.common.DataBoxException
- zpráva je podepsaná platným certifikátem - časové razítko je podepsané platným certifikátem - haš časového razítka a haš zprávy (element dmHash) jsou totožné a souhlasí se spočítaným hašem ze zprávy způsobem definovaným v dokumentaci k ISDS.
Validace zpráv probíha proti certifikátům, které jsou předány při volání konstruktoru této třídy, ne proti přiloženým certifikátům k časovému razítku či podpisu zprávy.
Pokud zpráva nesplnuje výše uvedené podmínky, je vyhozena vyjímka DataBoxException s detailním popisem chyby.
asPKCS7 - zpráva v obalu PKCS#7cz.abclinuxu.datoveschranky.common.DataBoxException - při neúspěšné validacipublic cz.abclinuxu.datoveschranky.common.entities.DeliveryInfo createDeliveryInfo(byte[] asPCKS7)
public static cz.abclinuxu.datoveschranky.common.entities.DeliveryInfo buildDeliveryInfo(cz.abclinuxu.datoveschranky.ws.dm.TDelivery delivery)
public static cz.abclinuxu.datoveschranky.common.entities.DeliveryInfo buildDeliveryInfo(cz.abclinuxu.datoveschranky.common.entities.MessageEnvelope env,
cz.abclinuxu.datoveschranky.ws.dm.TDelivery delivery)
protected cz.abclinuxu.datoveschranky.common.entities.Message buildMessage(cz.abclinuxu.datoveschranky.common.entities.MessageEnvelope envelope,
cz.abclinuxu.datoveschranky.ws.dm.TReturnedMessage message,
cz.abclinuxu.datoveschranky.common.interfaces.AttachmentStorer storer)
public cz.abclinuxu.datoveschranky.common.entities.Message readZFO(byte[] input,
cz.abclinuxu.datoveschranky.common.interfaces.AttachmentStorer storer)
protected static byte[] toByteArray(Element element)
Copyright © 2017. All rights reserved.