Package org.pgpainless.decryption_verification.syntax_check

# Class OpenPgpMessageSyntax

java.lang.Object
org.pgpainless.decryption_verification.syntax_check.OpenPgpMessageSyntax

All Implemented Interfaces:
  `Syntax`

public class OpenPgpMessageSyntax extends Object implements Syntax
This class describes the syntax for OpenPGP messages as specified by rfc4880.

See Also:
  - rfc4880 - §11.3. OpenPGP Messages
  - Blog post about theoretic background and translation of grammar to PDA syntax
  - Blog post about practically implementing the PDA for packet syntax validation

## Constructor Summary

Constructors
Constructor
Description
`OpenPgpMessageSyntax()`

## Method Summary

Modifier and Type
Method
Description
`Transition`
`transition(State from, InputSymbol input, StackSymbol stackItem)`
Describe a transition rule from `State`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### OpenPgpMessageSyntax

public OpenPgpMessageSyntax()

## Method Details

### transition

@Nonnull public Transition transition(@Nonnull State from, @Nonnull InputSymbol input, @Nullable StackSymbol stackItem) throws MalformedOpenPgpMessageException
Description copied from interface: `Syntax`
Describe a transition rule from `State`

    from

for `InputSymbol`

    input

with `StackSymbol`

    stackItem

from the top of the `PDAs` stack. The resulting `Transition` contains the new `State`, as well as a list of `StackSymbols` that get pushed onto the stack by the transition rule. If there is no applicable rule, a `MalformedOpenPgpMessageException` is thrown, since in this case the `InputSymbol` must be considered illegal.

Specified by:
  `transition` in interface `Syntax`
Parameters:
  `from` - current state of the PDA
  `input` - input symbol
  `stackItem` - item that got popped from the top of the stack
Returns:
  applicable transition rule containing the new state and pushed stack symbols
Throws:
  `MalformedOpenPgpMessageException` - if there is no applicable transition rule (the input symbol is illegal)