<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns="http://www.mitre.org/schema/openid-connect/jwt-signer"
	xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:beans="http://www.springframework.org/schema/beans"
	targetNamespace="http://www.mitre.org/schema/openid-connect/jwt-signer"
	elementFormDefault="qualified" attributeFormDefault="unqualified">

	<xsd:import namespace="http://www.springframework.org/schema/beans" schemaLocation="http://www.springframework.org/schema/beans/spring-beans-3.1.xsd" />

	<xsd:element name="keystore">
		
        <xsd:annotation>
			<xsd:documentation>
				Describes the JCE KeyStore necessary for certain
				signers.
			</xsd:documentation>
		</xsd:annotation>
        
        <xsd:complexType>
			<xsd:complexContent>
				<xsd:extension base="beans:identifiedType">
					<xsd:attribute name="location" type="xsd:string" use="required" />
					<xsd:attribute name="password" type="xsd:string" />
				</xsd:extension>
			</xsd:complexContent>
		</xsd:complexType>
    </xsd:element>

	<xsd:element name="service">
		
        <xsd:annotation>
			<xsd:documentation>
				Configures the signer service with these signers.
			</xsd:documentation>
		</xsd:annotation>
        
        <xsd:complexType>
			<xsd:complexContent>
				<xsd:extension base="beans:identifiedType">
					<xsd:choice minOccurs="0" maxOccurs="unbounded">
						<xsd:element name="rsa">
							<xsd:annotation>
								<xsd:documentation>
									Configures an RSA signer.
								</xsd:documentation>
							</xsd:annotation>
							<xsd:complexType>
								<xsd:attribute name="bits" type="xsd:string" />
								<xsd:attribute name="keystore-ref" type="xsd:string" use="required">
									<xsd:annotation>
										<xsd:documentation>
											The reference to the bean that defines the
											KeyStore.
										</xsd:documentation>
									</xsd:annotation>
								</xsd:attribute>
								<xsd:attribute name="key-alias" type="xsd:string" use="required">
									<xsd:annotation>
										<xsd:documentation>
											The alias to the KeyPair to use for
											signing/verifying.
										</xsd:documentation>
									</xsd:annotation>
								</xsd:attribute>
								<xsd:attribute name="password" type="xsd:string">
									<xsd:annotation>
										<xsd:documentation>
											The password to the KeyPair to use for
											signing/verifying.
										</xsd:documentation>
									</xsd:annotation>
								</xsd:attribute>
							</xsd:complexType>
						</xsd:element>
						<xsd:element name="ecdsa">
							<xsd:annotation>
								<xsd:documentation>
									Configures an ECDSA signer.
								</xsd:documentation>
							</xsd:annotation>
							<xsd:complexType>
								<xsd:attribute name="bits" type="xsd:string" />
								<xsd:attribute name="keystore-ref" type="xsd:string" use="required">
									<xsd:annotation>
										<xsd:documentation>
											The reference to the bean that defines the
											KeyStore.
										</xsd:documentation>
									</xsd:annotation>
								</xsd:attribute>
								<xsd:attribute name="key-alias" type="xsd:string" use="required">
									<xsd:annotation>
										<xsd:documentation>
											The alias to the KeyPair to use for
											signing/verifying.
										</xsd:documentation>
									</xsd:annotation>
								</xsd:attribute>
								<xsd:attribute name="password" type="xsd:string">
									<xsd:annotation>
										<xsd:documentation>
											The password to the KeyPair to use for
											signing/verifying.
										</xsd:documentation>
									</xsd:annotation>
								</xsd:attribute>
							</xsd:complexType>
						</xsd:element>
						<xsd:element name="hmac">
							<xsd:annotation>
								<xsd:documentation>
									Configures an HMAC signer.
								</xsd:documentation>
							</xsd:annotation>
							<xsd:complexType>
								<xsd:attribute name="bits" type="xsd:integer" />
								<xsd:attribute name="passphrase" type="xsd:string">
									<xsd:annotation>
										<xsd:documentation>
											The passphrase used for signing/verifying.
										</xsd:documentation>
									</xsd:annotation>
								</xsd:attribute>
							</xsd:complexType>
						</xsd:element>
					</xsd:choice>
				</xsd:extension>
			</xsd:complexContent>
		</xsd:complexType>
    </xsd:element>
</xsd:schema>