# zxid/sg/ws-trust-1.3.sg
# Slightly edited, 3.3.2007, Sampo Kellomaki (sampo@iki.fi)
# $Id: ws-trust-1.3.sg,v 1.3 2009-09-05 02:23:41 sampo Exp $

target(wst,  http://docs.oasis-open.org/ws-sx/ws-trust/200512/)
import(wsse, http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd, http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd)
import(wsu,  http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd, http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd)
import(wsp,  http://schemas.xmlsoap.org/ws/2004/09/policy, http://schemas.xmlsoap.org/ws/2004/09/policy/ws-policy.xsd)
import(a,    http://www.w3.org/2005/08/addressing, http://www.w3.org/2006/03/addressing/ws-addr.xsd)

RequestSecurityToken -> %wst:RequestSecurityTokenType
%RequestSecurityTokenType:
  wst:TokenType?
  wst:RequestType?
  wsp:AppliesTo?
  wst:Claims?
  wst:Entropy?
  wst:Lifetime?
  wst:AllowPostdating?
  wst:Renewing?
  wst:OnBehalfOf?
  wst:Issuer?
  wst:AuthenticationType?
  wst:KeyType?
  wst:KeySize?
  wst:SignatureAlgorithm?
  wst:Encryption?
  wst:EncryptionAlgorithm?
  wst:CanonicalizationAlgorithm?
  wst:ProofEncryption?
  wst:UseKey?
  wst:SignWith?
  wst:EncryptWith?
  wst:DelegateTo?
  wst:Forwardable?
  wst:Delegatable?
  wsp:Policy?
  wsp:PolicyReference?
  any*  processContents(lax)
  @Context? -> %xs:anyURI
  @any
  ;

TokenType -> %xs:anyURI

#RequestType -> %wst:RequestTypeOpenEnum
#%RequestTypeOpenEnum:  union(wst:RequestTypeEnum xs:anyURI)  ;
RequestType -> %wst:RequestTypeEnum
%RequestTypeEnum: enum( http://docs.oasis-open.org/ws-sx/ws-trust/200512/Issue http://docs.oasis-open.org/ws-sx/ws-trust/200512/Renew http://docs.oasis-open.org/ws-sx/ws-trust/200512/Cancel http://docs.oasis-open.org/ws-sx/ws-trust/200512/STSCancel http://docs.oasis-open.org/ws-sx/ws-trust/200512/Validate ) ;

RequestSecurityTokenResponse -> %wst:RequestSecurityTokenResponseType
%RequestSecurityTokenResponseType:
  wst:TokenType?
  wst:RequestType?
  wst:RequestedSecurityToken?
  wsp:AppliesTo?
  wst:RequestedAttachedReference?
  wst:RequestedUnattachedReference?
  wst:RequestedProofToken?
  wst:Entropy?
  wst:Lifetime?
  wst:Status?
  wst:AllowPostdating?
  wst:Renewing?
  wst:OnBehalfOf?
  wst:Issuer?
  wst:AuthenticationType?
  wst:Authenticator?
  wst:KeyType?
  wst:KeySize?
  wst:SignatureAlgorithm?
  wst:Encryption?
  wst:EncryptionAlgorithm?
  wst:CanonicalizationAlgorithm?
  wst:ProofEncryption?
  wst:UseKey?
  wst:SignWith?
  wst:EncryptWith?
  wst:DelegateTo?
  wst:Forwardable?
  wst:Delegatable?
  wsp:Policy?
  wsp:PolicyReference?
  any*  processContents(lax)
  @Context? -> %xs:anyURI
  @any
  ;

RequestedSecurityToken -> %wst:RequestedSecurityTokenType
%RequestedSecurityTokenType:
  any*  processContents(lax)
  ;

BinarySecret -> %wst:BinarySecretType
%BinarySecretType: base(xs:base64Binary)
  @Type? -> %wst:BinarySecretTypeEnum
  @any?
  ;

%BinarySecretTypeEnum: enum( http://docs.oasis-open.org/ws-sx/ws-trust/200512/AsymmetricKey http://docs.oasis-open.org/ws-sx/ws-trust/200512/SymmetricKey http://docs.oasis-open.org/ws-sx/ws-trust/200512/Nonce ) ;
#%BinarySecretTypeOpenEnum:  union(wst:BinarySecretTypeEnum xs:anyURI) ;

Claims -> %wst:ClaimsType
%ClaimsType:
  any* processContents(lax)
  @Dialect? -> %xs:anyURI
  @any?
  ;

Entropy -> %wst:EntropyType
%EntropyType:
  any* processContents(lax)
  @any?
  ;

Lifetime -> %wst:LifetimeType
%LifetimeType:
  wsu:Created?
  wsu:Expires?
  ;

RequestSecurityTokenCollection -> %wst:RequestSecurityTokenCollectionType
%RequestSecurityTokenCollectionType:
  wst:RequestSecurityToken{2,}
  ;

RequestSecurityTokenResponseCollection -> %wst:RequestSecurityTokenResponseCollectionType
%RequestSecurityTokenResponseCollectionType:
  wst:RequestSecurityTokenResponse+
  @any
  ;

#ComputedKey -> %wst:ComputedKeyOpenEnum
#%ComputedKeyOpenEnum:  union(wst:ComputedKeyEnum xs:anyURI)  ;
ComputedKey -> %wst:ComputedKeyEnum
%ComputedKeyEnum: enum( http://docs.oasis-open.org/ws-sx/ws-trust/200512/CK/PSHA1 http://docs.oasis-open.org/ws-sx/ws-trust/200512/CK/HASH ) ;

RequestedAttachedReference   -> %wst:RequestedReferenceType
RequestedUnattachedReference -> %wst:RequestedReferenceType
%RequestedReferenceType:
  wsse:SecurityTokenReference
  ;

RequestedProofToken -> %wst:RequestedProofTokenType
%RequestedProofTokenType:
  any*  processContents(lax)
  ;

IssuedTokens -> %wst:RequestSecurityTokenResponseCollectionType

RenewTarget  -> %wst:RenewTargetType
%RenewTargetType:
  any*  ns(##other)
  ;

AllowPostdating -> %wst:AllowPostdatingType

Renewing -> %wst:RenewingType
%RenewingType:
  @Allow? -> %xs:boolean
  @OK? -> %xs:boolean
  ;

CancelTarget -> %wst:CancelTargetType
%CancelTargetType:
  any*  ns(##other)
  ;

RequestedTokenCancelled -> %wst:RequestedTokenCancelledType

ValidateTarget -> %wst:ValidateTargetType
%ValidateTargetType:
  any*  ns(##other)
  ;

Status -> %wst:StatusType
%StatusType:
  wst:Code -> %wst:StatusCodeEnum
  wst:Reason? -> %xs:string
  ;

%StatusCodeEnum: enum( http://docs.oasis-open.org/ws-sx/ws-trust/200512/status/valid http://docs.oasis-open.org/ws-sx/ws-trust/200512/status/invalid ) ;
#%StatusCodeOpenEnum:  union(wst:StatusCodeEnum xs:anyURI)  ;

SignChallenge -> %wst:SignChallengeType
SignChallengeResponse -> %wst:SignChallengeType
%SignChallengeType:
  wst:Challenge
  any*  processContents(lax)
  @any? #  ns(##any)
  ;

Challenge -> %xs:string

BinaryExchange -> %wst:BinaryExchangeType
%BinaryExchangeType: base(xs:string)
  @ValueType     -> %xs:anyURI
  @EncodingType  -> %xs:anyURI
  @any?
  ;

RequestKET -> %wst:RequestKETType

KeyExchangeToken -> %wst:KeyExchangeTokenType
%KeyExchangeTokenType:
  any*  processContents(lax)
  ;

Authenticator -> %wst:AuthenticatorType
%AuthenticatorType:
  wst:CombinedHash?
  any*  ns(##other)  processContents(lax)
  ;

CombinedHash -> %xs:base64Binary

OnBehalfOf -> %wst:OnBehalfOfType
%OnBehalfOfType:
  any*  processContents(lax)
  ;

Issuer -> %a:EndpointReferenceType

AuthenticationType -> %xs:anyURI

#KeyType	 -> %wst:KeyTypeOpenEnum
#%KeyTypeOpenEnum:  union(wst:KeyTypeEnum xs:anyURI)  ;
KeyType	 -> %wst:KeyTypeEnum
%KeyTypeEnum: enum( http://docs.oasis-open.org/ws-sx/ws-trust/200512/PublicKey http://docs.oasis-open.org/ws-sx/ws-trust/200512/SymmetricKey http://docs.oasis-open.org/wssx/wstrust/200512/Bearer ) ;

KeySize -> %xs:unsignedInt

SignatureAlgorithm -> %xs:anyURI

EncryptionAlgorithm -> %xs:anyURI

CanonicalizationAlgorithm -> %xs:anyURI

ComputedKeyAlgorithm -> %xs:anyURI

Encryption -> %wst:EncryptionType
%EncryptionType:
  any*  processContents(lax)
  ;

ProofEncryption -> %wst:ProofEncryptionType
%ProofEncryptionType:
  any*  processContents(lax)
  ;

UseKey -> %wst:UseKeyType
%UseKeyType:
  any?  processContents(lax)
  @Sig?	 -> %xs:anyURI
  ;

KeyWrapAlgorithm -> %xs:anyURI

SignWith -> %xs:anyURI

EncryptWith -> %xs:anyURI

DelegateTo -> %wst:DelegateToType
%DelegateToType:
  any*  processContents(lax)
  ;

Forwardable -> %xs:boolean

Delegatable -> %xs:boolean

Participants -> %wst:ParticipantsType
%ParticipantsType:
  wst:Primary?     -> %wst:ParticipantType
  wst:Participant* -> %wst:ParticipantType
  any*  ns(##other)  processContents(lax)
  ;

%ParticipantType:
  any*  processContents(lax)
  ;

#EOF
