-- Module SeseAPDUs (X.832:04/1995)
-- See also ITU-T X.832 (04/1995)
-- See also the index of all ASN.1 assignments needed in this document

SeseAPDUs {joint-iso-itu-t genericULS(20) modules(1) seseAPDUs(6)} DEFINITIONS
AUTOMATIC TAGS ::=
BEGIN

-- EXPORTS ALL 
IMPORTS
  notation
    FROM ObjectIdentifiers {joint-iso-itu-t genericULS(20) modules(1)
      objectIdentifiers(0)}
  dirAuthenticationTwoWay
    FROM GulsSecurityExchanges {joint-iso-itu-t genericULS(20) modules(1)
      gulsSecurityExchanges(2)}
  SECURITY-EXCHANGE, SE-ERROR
    FROM Notation {joint-iso-itu-t genericULS(20) modules(1) notation(1)};

SESEapdus{SECURITY-EXCHANGE:ValidSEs, InvocationId:InvocationIdSet} ::=
  CHOICE {
  se-transfer  SETransfer{{ValidSEs}, {InvocationIdSet}},
  se-u-abort   SEUAbort{{ValidSEs}, {InvocationIdSet}},
  se-p-abort   SEPAbort{{ValidSEs}, {InvocationIdSet}}
}

SETransfer{SECURITY-EXCHANGE:ValidSEs, InvocationId:InvocationIdSet} ::=
  SEQUENCE {
  seIdentifier    SECURITY-EXCHANGE.&sE-Identifier({ValidSEs}),
  -- This identifies one of the security- 
  -- exchanges supported by the particular SESE 
  -- abstract syntax
  itemIdentifier
    SECURITY-EXCHANGE.&SE-Items.&itemId({ValidSEs}{@seIdentifier}),
  -- This identifies one of the security-
  -- exchange-items of the security exchange 
  -- indicated by "seIdentifier" 
  seItem
    SECURITY-EXCHANGE.&SE-Items.&ItemType
      ({ValidSEs}{@seIdentifier, @itemIdentifier}),
  invocationId
    InvocationId(InvocationIdSet)
      (CONSTRAINED BY {-- Must be the same as the---- invocationId on an active security exchange--
         
         -- if start flag is not true -- }) DEFAULT noInvocationId,
  startFlag       BOOLEAN DEFAULT FALSE,
  -- This field is set only as the first security-
  -- exchange-item of a security-exchange is 
  -- transferred. 
  endFlag         BOOLEAN DEFAULT FALSE-- This field is set as the last security-exchange- 
-- item of a security-exchange is transferred. It is 
-- needed to accommodate those mechanisms requiring 
-- n exchanges, where n is not known a priori 
}

SEUAbort{SECURITY-EXCHANGE:ValidSEs, InvocationId:InvocationIdSet} ::=
  SEQUENCE {
  invocationId
    InvocationId(InvocationIdSet)
      (CONSTRAINED BY {-- Must be the same as the----  invocationId on an active or just-completed--
         
         --  security exchange -- }) DEFAULT noInvocationId,
  itemIdentifier
    SECURITY-EXCHANGE.&SE-Items.&itemId({ValidSEs.&SE-Items})
      OPTIONAL,
  --  This component will only be present
  --  when the Abort is generated subsequent
  --  to receipt of a SETransfer APDU.
  errors          SEQUENCE OF SEerror{{ValidSEs}} OPTIONAL
  --  needed to handle multiple error codes 
}

SEPAbort{SECURITY-EXCHANGE:ValidSEs, InvocationId:InvocationIdSet} ::=
  SEQUENCE {
  invocationId    InvocationId(InvocationIdSet) OPTIONAL,
  itemIdentifier
    SECURITY-EXCHANGE.&SE-Items.&itemId({ValidSEs.&SE-Items})
      OPTIONAL,
  --  This component will only be present
  --  when the Abort is generated subsequent
  --  to receipt of a SETransfer APDU.
  problemCode     ProblemCode
}

InvocationId ::= CHOICE {present  INTEGER,
                         absent   NULL
}

noInvocationId InvocationId ::= absent:NULL

NoInvocationId InvocationId ::= {noInvocationId}

SEerror{SECURITY-EXCHANGE:ValidSEs} ::= SEQUENCE {
  errorCode       SE-ERROR.&errorCode({Errors{{ValidSEs}}})  OPTIONAL,
  errorParameter
    SE-ERROR.&ParameterType({Errors{{ValidSEs}}})  OPTIONAL
}

Errors{SECURITY-EXCHANGE:ValidSEs} SE-ERROR ::=
  {ValidSEs.&SE-Items.&Errors}

ProblemCode ::= CHOICE {
  general   GeneralProblem,
  transfer  TransferProblem,
  abort     AbortProblem
}

GeneralProblem ::= ENUMERATED {invalidAPDU(0)}

TransferProblem ::= ENUMERATED {
  duplicateInvocationId(0), unrecognizedSecurityExchange(1), mistypedItem(2),
  inappropriateInvocationId(3), alternatingSequenceError(4)}

AbortProblem ::= ENUMERATED {
  unrecognizedInvocationId(0), abortUnexpected(1), unrecognizedError(2),
  unexpectedError(3), mistypedErrorParameter(4)}

END
-- Generated by Asnp, the ASN.1 pretty-printer of France Telecom R&D