commiting windows plugin

revert-dabc3590
asok 10 years ago
parent eb52073e37
commit ebe0aa2663

@ -0,0 +1,52 @@
/*
* Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package cdm.api.windows.DiscoveryService;
import cdm.api.windows.DiscoveryService.beans.in.DiscoveryRequest;
import cdm.api.windows.DiscoveryService.beans.out.Message;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebResult;
import javax.jws.WebService;
import javax.ws.rs.*;
import javax.ws.rs.core.Response;
import javax.xml.ws.BindingType;
import javax.xml.ws.RequestWrapper;
import javax.xml.ws.ResponseWrapper;
import javax.xml.ws.soap.SOAPBinding;
@WebService(targetNamespace = "http://schemas.microsoft.com/windows/management/2012/01/enrollment", name = "IDiscoveryService")
@BindingType(value = SOAPBinding.SOAP12HTTP_BINDING)
public interface DiscoveryServiceGet {
@POST
@WebMethod(operationName = "Discover")
@RequestWrapper(targetNamespace = "http://schemas.microsoft.com/windows/management/2012/01/enrollment")
@ResponseWrapper(targetNamespace = "http://schemas.microsoft.com/windows/management/2012/01/enrollment")
@WebResult(name = "DiscoverResult") Message Discover(
@WebParam(name = "request")
DiscoveryRequest request);
@GET
@WebMethod
@WebResult() Response DiscoverGet();
}

@ -0,0 +1,61 @@
/*
* Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package cdm.api.windows.DiscoveryService.beans.in;
import javax.xml.bind.annotation.*;
import java.io.Serializable;
@XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD)
public class DiscoveryRequest implements Serializable {
@XmlElement(name = "EmailAddress")
private String emailId;
@XmlElement(name = "RequestVersion")
private String version;
@XmlElement(name = "DeviceType")
private String deviceType;
public String getEmailId() {
return emailId;
}
public String getVersion() {
return version;
}
public void setEmailId(String emailId) {
this.emailId = emailId;
}
public void setVersion(String version) {
this.version = version;
}
public String getDeviceType() {
return deviceType;
}
public void setDeviceType(String deviceType) {
this.deviceType = deviceType;
}
}

@ -0,0 +1,24 @@
/*
* Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
@javax.xml.bind.annotation.XmlSchema(namespace = "http://schemas.microsoft.com/windows/pki/2009/01/enrollment", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
package cdm.api.windows.DiscoveryService.beans.in;

@ -0,0 +1,58 @@
/*
* Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package cdm.api.windows.DiscoveryService.beans.out;
import javax.xml.bind.annotation.*;
import java.io.Serializable;
@XmlRootElement
public class Message implements Serializable {
private String authPolicy;
private String enrollmentPolicyServiceUrl;
private String enrollmentServiceUrl;
@XmlElement(name = "AuthPolicy", namespace = "http://schemas.microsoft.com/windows/management/2012/01/enrollment")
public String getAuthPolicy() {
return authPolicy;
}
@XmlElement(name = "EnrollmentPolicyServiceUrl", namespace = "http://schemas.microsoft.com/windows/management/2012/01/enrollment")
public String getEnrollmentPolicyServiceUrl() {
return enrollmentPolicyServiceUrl;
}
@XmlElement(name = "EnrollmentServiceUrl", namespace = "http://schemas.microsoft.com/windows/management/2012/01/enrollment")
public String getEnrollmentServiceUrl() {
return enrollmentServiceUrl;
}
public void setAuthPolicy(String authPolicy) {
this.authPolicy = authPolicy;
}
public void setEnrollmentPolicyServiceUrl(String enrollmentPolicyServiceUrl) {
this.enrollmentPolicyServiceUrl = enrollmentPolicyServiceUrl;
}
public void setEnrollmentServiceUrl(String enrollmentServiceUrl) {
this.enrollmentServiceUrl = enrollmentServiceUrl;
}
}

@ -0,0 +1,64 @@
/*
* Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package cdm.api.windows.DiscoveryService.impl;
import cdm.api.windows.DiscoveryService.beans.in.DiscoveryRequest;
import cdm.api.windows.DiscoveryService.DiscoveryServiceGet;
import cdm.api.windows.DiscoveryService.beans.out.Message;
import org.apache.log4j.Logger;
import javax.jws.WebService;
import javax.ws.rs.core.Response;
import javax.xml.ws.BindingType;
import javax.xml.ws.soap.Addressing;
import javax.xml.ws.soap.SOAPBinding;
@WebService(endpointInterface = "cdm.api.windows.DiscoveryService.DiscoveryServiceGet", targetNamespace = "http://schemas.microsoft.com/windows/management/2012/01/enrollment")
@Addressing(enabled = true, required = true)
@BindingType(value = SOAPBinding.SOAP12HTTP_BINDING)
public class DiscoveryServiceGetImpl implements DiscoveryServiceGet {
private Logger LOGGER = Logger.getLogger(DiscoveryServiceGetImpl.class);
@Override
public Message Discover(DiscoveryRequest disRequest) {
System.out.println("CHECK_SECOND_POST");
Message message = new Message();
message.setAuthPolicy("OnPremise");
message.setEnrollmentPolicyServiceUrl(
"https://EnterpriseEnrollment.wso2.com/ENROLLMENTSERVER/PolicyEnrollmentWebservice.svc");
message.setEnrollmentServiceUrl(
"https://EnterpriseEnrollment.wso2.com/ENROLLMENTSERVER/DeviceEnrollmentWebservice.svc");
LOGGER.info("Received Discovery Service Request");
return message;
}
@Override
public Response DiscoverGet() {
System.out.println("CHECK_FIRST_GET");
return Response.ok().build();
}
}

@ -0,0 +1,54 @@
/*
* Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package cdm.api.windows.wstep;
import cdm.api.windows.wstep.beans.RequestSecurityTokenResponse;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebResult;
import javax.jws.WebService;
import javax.ws.rs.*;
import javax.xml.bind.annotation.XmlSeeAlso;
import javax.xml.ws.Action;
import javax.xml.ws.RequestWrapper;
import javax.xml.ws.ResponseWrapper;
import javax.xml.ws.soap.SOAPBinding;
import javax.xml.ws.BindingType;
@WebService(targetNamespace = "http://schemas.microsoft.com/windows/pki/2009/01/enrollment/RSTRC", name = "wstep")
@BindingType(value = SOAPBinding.SOAP12HTTP_BINDING)
public interface CertificateEnrollmentService {
@RequestWrapper(localName = "RequestSecurityToken", targetNamespace = "http://docs.oasis-open.org/ws-sx/ws-trust/200512")
@WebMethod(operationName = "RequestSecurityToken")
@ResponseWrapper(localName = "RequestSecurityTokenResponseCollection", targetNamespace = "http://docs.oasis-open.org/ws-sx/ws-trust/200512")
public void RequestSecurityToken(
@WebParam(name = "TokenType", targetNamespace = "http://docs.oasis-open.org/ws-sx/ws-trust/200512")
String TokenType,
@WebParam(name = "RequestType", targetNamespace = "http://docs.oasis-open.org/ws-sx/ws-trust/200512")
String RequestType,
@WebParam(name = "BinarySecurityToken", targetNamespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd")
String BinarySecurityToken,
@WebParam(name = "AdditionalContext", targetNamespace = "http://schemas.xmlsoap.org/ws/2006/12/authorization")
cdm.api.windows.wstep.beans.AdditionalContext AdditionalContext,
@WebParam(mode = WebParam.Mode.OUT, name = "RequestSecurityTokenResponse", targetNamespace = "http://docs.oasis-open.org/ws-sx/ws-trust/200512")
javax.xml.ws.Holder<RequestSecurityTokenResponse> response
);
}

@ -0,0 +1,45 @@
/*
* Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package cdm.api.windows.wstep.beans;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "OIDCollection", namespace = "http://schemas.xmlsoap.org/ws/2006/12/authorization", propOrder = {
"contextitem"
})
public class AdditionalContext {
@XmlElement(name = "ContextItem", required = true)
protected List<ContextItem> contextitem;
public List<ContextItem> getcontextitem() {
if (contextitem == null) {
contextitem = new ArrayList<ContextItem>();
}
return this.contextitem;
}
}

@ -0,0 +1,60 @@
/*
* Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package cdm.api.windows.wstep.beans;
import javax.xml.bind.annotation.*;
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "BinarySecurityToken", namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd")
public class BinarySecurityToken {
@XmlAttribute(name = "ValueType")
protected String ValueType;
@XmlAttribute(name = "EncodingType")
protected String EncodingType;
@XmlValue
protected String Token;
public void setValueType(String valuetype) {
this.ValueType = valuetype;
}
public String getValueType() {
return this.ValueType;
}
public void setEncodingType(String encodingtype) {
this.EncodingType = encodingtype;
}
public String getEncodingType() {
return this.EncodingType;
}
public void setToken(String token) {
this.Token = token;
}
public String getToken() {
return this.Token;
}
}

@ -0,0 +1,43 @@
/*
* Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package cdm.api.windows.wstep.beans;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "ContextItem", namespace = "http://schemas.xmlsoap.org/ws/2006/12/authorization", propOrder = {
"Value"
})
public class ContextItem {
@XmlElement(required = true)
protected String Value;
public String getValue() {
return Value;
}
public void setValue(String value) {
Value = value;
}
}

@ -0,0 +1,40 @@
/*
* Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package cdm.api.windows.wstep.beans;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "RequestedSecurityToken", namespace = "http://docs.oasis-open.org/ws-sx/ws-trust/200512", propOrder = {
"binarySecurityToken"
})
public class RequestSecurityToken {
@XmlElement(name = "BinarySecurityToken", required = true, namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd")
protected BinarySecurityToken binarySecurityToken;
public void setBinarySecurityToken(BinarySecurityToken binarysecuritytoken) {
this.binarySecurityToken = binarysecuritytoken;
}
}

@ -0,0 +1,71 @@
/*
* Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package cdm.api.windows.wstep.beans;
import cdm.api.windows.wstep.beans.AdditionalContext;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "RequestSecurityTokenResponse", namespace = "http://docs.oasis-open.org/ws-sx/ws-trust/200512", propOrder = {
"TokenType",
"RequestedSecurityToken",
"RequestID"
})
public class RequestSecurityTokenResponse implements Serializable {
@XmlElement(name = "TokenType", namespace = "http://docs.oasis-open.org/ws-sx/ws-trust/200512")
private String TokenType;
@XmlElement(name = "RequestedSecurityToken", required = true, namespace = "http://docs.oasis-open.org/ws-sx/ws-trust/200512")
private RequestedSecurityToken RequestedSecurityToken;
@XmlElement(name = "RequestID", namespace = "http://docs.oasis-open.org/ws-sx/ws-trust/200512")
private int RequestID;
public String getTokenType() {
return TokenType;
}
public void setTokenType(String tokenType) {
TokenType = tokenType;
}
public RequestedSecurityToken getRequestedSecurityToken() {
return RequestedSecurityToken;
}
public void setRequestedSecurityToken(RequestedSecurityToken requestedSecurityToken) {
RequestedSecurityToken = requestedSecurityToken;
}
public int getRequestID() {
return RequestID;
}
public void setRequestID(int requestID) {
RequestID = requestID;
}
}

@ -0,0 +1,45 @@
/*
* Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package cdm.api.windows.wstep.beans;
import cdm.api.windows.wstep.beans.ContextItem;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
import java.util.ArrayList;
import java.util.List;
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "RequestedSecurityToken", namespace = "http://docs.oasis-open.org/ws-sx/ws-trust/200512", propOrder = {
"binarySecurityToken"
})
public class RequestedSecurityToken {
@XmlElement(name = "BinarySecurityToken", required = true, namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd")
protected BinarySecurityToken binarySecurityToken;
public void setBinarySecurityToken(BinarySecurityToken binarysecuritytoken) {
this.binarySecurityToken = binarysecuritytoken;
}
}

@ -0,0 +1,27 @@
/*
* Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
@XmlSchema(namespace = "http://www.w3.org/2003/05/soap-envelope",
xmlns = {
@XmlNs(prefix = "", namespaceURI = "http://www.w3.org/2003/05/soap-envelope"),
}, elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
package com.ex.wstep;
import javax.xml.bind.annotation.XmlNs;
import javax.xml.bind.annotation.XmlSchema;

@ -0,0 +1,195 @@
/*
* Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package cdm.api.windows.wstep.impl;
import cdm.api.windows.wstep.beans.AdditionalContext;
import cdm.api.windows.wstep.CertificateEnrollmentService;
import cdm.api.windows.wstep.beans.BinarySecurityToken;
import javax.jws.WebService;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import javax.xml.ws.BindingType;
import javax.xml.ws.Holder;
import javax.xml.ws.soap.Addressing;
import javax.xml.ws.soap.SOAPBinding;
import org.apache.commons.codec.digest.DigestUtils;
import cdm.api.windows.wstep.beans.RequestSecurityTokenResponse;
import cdm.api.windows.wstep.beans.RequestedSecurityToken;
import cdm.api.windows.wstep.util.CertificateSigningService;
import cdm.api.windows.wstep.util.KeyStoreGenerator;
import org.apache.log4j.Logger;
import org.bouncycastle.pkcs.PKCS10CertificationRequest;
import org.bouncycastle.pkcs.jcajce.JcaPKCS10CertificationRequest;
import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import sun.misc.BASE64Encoder;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.StringWriter;
import java.security.KeyStore;
import java.security.PrivateKey;
import java.security.cert.Certificate;
import java.security.cert.CertificateFactory;
import java.security.cert.X509Certificate;
@WebService(endpointInterface = "cdm.api.windows.wstep.CertificateEnrollmentService", targetNamespace = "http://schemas.microsoft.com/windows/pki/2009/01/enrollment/RSTRC")
@Addressing(enabled = true, required = true)
@BindingType(value = SOAPBinding.SOAP12HTTP_BINDING)
public class CertificateEnrollmentServiceImpl implements CertificateEnrollmentService {
private Logger LOGGER = Logger.getLogger(CertificateEnrollmentServiceImpl.class);
PrivateKey privateKey;
X509Certificate rooCACertificate;
JcaPKCS10CertificationRequest csrReq;
PKCS10CertificationRequest certificationRequest;
String wapProvisioningXmlFile;
DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance();
@Override public void RequestSecurityToken(String TokenType, String RequestType,
String BinarySecurityToken,
AdditionalContext AdditionalContext,
Holder<RequestSecurityTokenResponse> response) {
certificateSign();
//////////
System.out.println("\n\n\n"+"REQUEST_CSR:"+BinarySecurityToken+"\n\n\n");
//////////
File file = new File(getClass().getClassLoader().getResource("wap-provisioning.xml").getFile());
wapProvisioningXmlFile = file.getPath();
String encodedWap="Initial_test";
RequestSecurityTokenResponse rs = new RequestSecurityTokenResponse();
rs.setTokenType(
"http://schemas.microsoft.com/5.0.0.0/ConfigurationManager/Enrollment/DeviceEnrollmentToken");
try {
byte[] derByteArray = javax.xml.bind.DatatypeConverter.parseBase64Binary(BinarySecurityToken);
certificationRequest = new PKCS10CertificationRequest(derByteArray);
csrReq = new JcaPKCS10CertificationRequest(certificationRequest);
X509Certificate signedCert = CertificateSigningService.signCSR(csrReq, privateKey, rooCACertificate);
System.out.println("PUBLIC KEY OF SIGNED CERT :"+signedCert.getPublicKey()+"\n\n\n");
System.out.println("PUBLIC KEY OF CSR :"+csrReq.getPublicKey()+"\n\n\n");
BASE64Encoder base64Encoder = new BASE64Encoder();
String rootCertEncodedString = base64Encoder.encode(rooCACertificate.getEncoded());
String signedCertEncoded = base64Encoder.encode(signedCert.getEncoded());
DocumentBuilder builder = domFactory.newDocumentBuilder();
Document dDoc = builder.parse(wapProvisioningXmlFile);
NodeList wapParm = dDoc.getElementsByTagName("parm");
/////////
wapParm.item(0).getParentNode().getAttributes().getNamedItem("type").setTextContent(String.valueOf(
DigestUtils.sha1Hex(rooCACertificate.getEncoded())));
/////////
NamedNodeMap rootCertAttributes = wapParm.item(0).getAttributes();
Node b64Encoded = rootCertAttributes.getNamedItem("value");
rootCertEncodedString=rootCertEncodedString.replaceAll("\n","");
b64Encoded.setTextContent(rootCertEncodedString);
System.out.println("COPY_ROOT_CERT:"+rootCertEncodedString);
/////////
wapParm.item(1).getParentNode().getAttributes().getNamedItem("type").setTextContent(String.valueOf(DigestUtils.sha1Hex(signedCert.getEncoded())));
/////////
NamedNodeMap clientCertAttributes = wapParm.item(1).getAttributes();
Node b64CliendEncoded = clientCertAttributes.getNamedItem("value");
signedCertEncoded=signedCertEncoded.replaceAll("\n","");
b64CliendEncoded.setTextContent(signedCertEncoded);
System.out.println("COPY_SIGNED_CERT:"+signedCertEncoded);
String wapProvisioning = convertDocumentToString(dDoc);
///////
System.out.println("WAP_XML:"+wapProvisioning+"\n\n\n");
///////
encodedWap = base64Encoder.encode(wapProvisioning.getBytes());
} catch (Exception e) {
//throw
}
RequestedSecurityToken rst = new RequestedSecurityToken();
BinarySecurityToken BinarySecToken=new BinarySecurityToken();
BinarySecToken.setValueType("http://schemas.microsoft.com/5.0.0.0/ConfigurationManager/Enrollment/DeviceEnrollmentProvisionDoc");
BinarySecToken.setEncodingType(
"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd#base64binary");
BinarySecToken.setToken(encodedWap);
rst.setBinarySecurityToken(BinarySecToken);
rs.setRequestedSecurityToken(rst);
rs.setRequestID(0);
response.value = rs;
}
private String convertDocumentToString(Document document) throws Exception {
DOMSource domSource = new DOMSource(document);
StringWriter writer = new StringWriter();
StreamResult result = new StreamResult(writer);
TransformerFactory tf = TransformerFactory.newInstance();
Transformer transformer = tf.newTransformer();
transformer.transform(domSource, result);
String wapProvisioning = writer.toString();
return wapProvisioning;
}
public void certificateSign() {
try {
KeyStore securityJks = KeyStoreGenerator.getKeyStore();
String pass = "wso2carbon";
KeyStoreGenerator.loadToStore(securityJks, pass.toCharArray(), "/Users/asok/Downloads/wso2as-5.2.1/repository/resources/security/wso2carbon.jks");
PrivateKey privateKeyCA = (PrivateKey) securityJks.getKey("wso2carbon", pass.toCharArray());
privateKey=privateKeyCA;
Certificate cartificateCA = securityJks.getCertificate(pass);
CertificateFactory cf = CertificateFactory.getInstance("X.509");
ByteArrayInputStream bais = new ByteArrayInputStream(cartificateCA.getEncoded());
X509Certificate cartificateCAX509 = (X509Certificate) cf.generateCertificate(bais);
rooCACertificate=cartificateCAX509;
} catch (Exception e) {
e.printStackTrace();
}
}
}

@ -0,0 +1,36 @@
/*
* Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package cdm.api.windows.wstep.util;
/**
* Custom exception handling class, to handle the issue that come up during
* execution of Apk and certificate generation.
*/
public class ApkGenerationException extends Exception {
public ApkGenerationException(String message) {
super(message);
}
public ApkGenerationException(String message, Throwable e) {
super(message, e);
}
}

@ -0,0 +1,104 @@
package cdm.api.windows.wstep.util;
//REMOVE THIS LATER
import org.apache.log4j.Logger;
import org.bouncycastle.asn1.x500.X500Name;
import org.bouncycastle.asn1.x509.*;
import org.bouncycastle.cert.X509CertificateHolder;
import org.bouncycastle.cert.X509v3CertificateBuilder;
import org.bouncycastle.cert.jcajce.JcaX509CertificateConverter;
import org.bouncycastle.cert.jcajce.JcaX509ExtensionUtils;
import org.bouncycastle.cert.jcajce.JcaX509v3CertificateBuilder;
import org.bouncycastle.crypto.params.AsymmetricKeyParameter;
import org.bouncycastle.crypto.util.PrivateKeyFactory;
import org.bouncycastle.jce.PKCS10CertificationRequest;
import org.bouncycastle.operator.ContentSigner;
import org.bouncycastle.operator.DefaultDigestAlgorithmIdentifierFinder;
import org.bouncycastle.operator.DefaultSignatureAlgorithmIdentifierFinder;
import org.bouncycastle.operator.OperatorCreationException;
import org.bouncycastle.operator.bc.BcRSAContentSignerBuilder;
import org.bouncycastle.operator.jcajce.JcaContentSignerBuilder;
//import org.bouncycastle.pkcs.PKCS10CertificationRequestHolder;
import org.bouncycastle.pkcs.jcajce.JcaPKCS10CertificationRequest;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.math.BigInteger;
import java.security.*;
import java.security.cert.CertificateException;
import java.security.cert.CertificateFactory;
import java.security.cert.X509Certificate;
import java.util.Date;
public class CertificateSigningService {
private static Logger LOGGER = Logger.getLogger(CertificateSigningService.class);
/*public static X509Certificate sign(PKCS10CertificationRequest inputCSR, PrivateKey caPrivate, X509Certificate caCertificate)
throws InvalidKeyException, NoSuchAlgorithmException,NoSuchProviderException, SignatureException, IOException,
OperatorCreationException, CertificateException {
AlgorithmIdentifier sigAlgId = new DefaultSignatureAlgorithmIdentifierFinder().find("SHA1withRSA");
AlgorithmIdentifier digAlgId = new DefaultDigestAlgorithmIdentifierFinder().find(sigAlgId);
AsymmetricKeyParameter foo = PrivateKeyFactory.createKey(caPrivate.getEncoded());
//SubjectPublicKeyInfo keyInfo = SubjectPublicKeyInfo.getInstance(pair.getPublic().getEncoded());
PKCS10CertificationRequestHolder pk10Holder = new PKCS10CertificationRequestHolder(inputCSR);
SubjectPublicKeyInfo csrKeyInfo = pk10Holder.getSubjectPublicKeyInfo();
LOGGER.info("CN of the Device's CSR : " + pk10Holder.getSubject().toString());
X509v3CertificateBuilder myCertificateGenerator = new X509v3CertificateBuilder(
new X500Name(caCertificate.getIssuerX500Principal().getName()), BigInteger.valueOf(new SecureRandom().nextInt(Integer.MAX_VALUE)), new Date(System.currentTimeMillis() - 1000L * 60 * 60 * 24 * 30),
new Date(System.currentTimeMillis() + (1000L * 60 * 60 * 24 * 365*10)), new X500Name("CN=abimaran"), csrKeyInfo);
ContentSigner sigGen = new BcRSAContentSignerBuilder(sigAlgId, digAlgId).build(foo);
X509CertificateHolder holder = myCertificateGenerator.build(sigGen);
X509CertificateStructure eeX509CertificateStructure = holder.toASN1Structure();
CertificateFactory cf = CertificateFactory.getInstance("X.509", "BC");
// Read Certificate
InputStream is1 = new ByteArrayInputStream(eeX509CertificateStructure.getEncoded());
X509Certificate theCert = (X509Certificate) cf.generateCertificate(is1);
LOGGER.info("Signed Certificate CN : " + theCert.getSubjectDN().getName());
LOGGER.info("Signed CSR's public key : " + theCert.getPublicKey());
is1.close();
return theCert;
}*/
public static X509Certificate signCSR(JcaPKCS10CertificationRequest jcaRequest, PrivateKey privateKey, X509Certificate caCert) throws Exception{
try {
X509v3CertificateBuilder certificateBuilder = new JcaX509v3CertificateBuilder(caCert,
BigInteger.valueOf(new SecureRandom().nextInt(Integer.MAX_VALUE)), new Date(System.currentTimeMillis() - 1000L * 60 * 60 * 24 * 30),
new Date(System.currentTimeMillis() + (1000L * 60 * 60 * 24 * 365*10)), new X500Name("CN=abimaran"), jcaRequest.getPublicKey());
JcaX509ExtensionUtils extUtils = new JcaX509ExtensionUtils();
ContentSigner signer = new JcaContentSignerBuilder("SHA1withRSA").setProvider("BC").build(privateKey);
X509Certificate theCert = new JcaX509CertificateConverter().setProvider("BC").getCertificate(certificateBuilder.build(signer));
LOGGER.info("Signed Certificate CN : " + theCert.getSubjectDN().getName());
LOGGER.info("Signed CSR's public key : " + theCert.getPublicKey());
return theCert;
} catch (Exception e) {
throw new Exception("Error in signing the certificate", e);
}
}
}

@ -0,0 +1,77 @@
/*
* Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package cdm.api.windows.wstep.util;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import java.math.BigInteger;
import java.security.PrivateKey;
import java.security.PublicKey;
import java.security.SecureRandom;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
import java.util.Date;
import org.spongycastle.asn1.x500.X500Name;
import org.spongycastle.cert.X509v3CertificateBuilder;
import org.spongycastle.cert.jcajce.JcaX509CertificateConverter;
import org.spongycastle.cert.jcajce.JcaX509v3CertificateBuilder;
import org.spongycastle.operator.ContentSigner;
import org.spongycastle.operator.OperatorCreationException;
import org.spongycastle.operator.jcajce.JcaContentSignerBuilder;
/**
* Generate X509 V3 certificates. CA, RA and SSL can be generated, where
* intermediate certificates are signed from the root certificate to generate
* the chain.
*/
public class CertificateUtil {
private static final Log LOG = LogFactory.getLog(CertificateUtil.class);
public static X509Certificate signCSR(PublicKey publicKeyToBeSigned, PrivateKey caPrivateKey, X509Certificate caCert) throws Exception{
try {
X509v3CertificateBuilder certificateBuilder = new JcaX509v3CertificateBuilder(caCert,
BigInteger
.valueOf(new SecureRandom().nextInt(Integer.MAX_VALUE)),
new Date(System.currentTimeMillis()),
new Date(System.currentTimeMillis() + (1000L * 60 * 60 * 24 * 365*10)),
new X500Name("CN=abimaran"),
publicKeyToBeSigned);
ContentSigner signer = new JcaContentSignerBuilder("SHA1withRSA").setProvider("SC").build(caPrivateKey);
X509Certificate theCert = new JcaX509CertificateConverter().setProvider("SC").getCertificate(certificateBuilder.build(signer));
return theCert;
} catch (OperatorCreationException e) {
String message = "Error creating ContentSigner with JcaContentSignerBuilder"
+ " with the private key provided.";
LOG.error(message, e);
throw new ApkGenerationException(message, e);
} catch (CertificateException e) {
String message = "Error building certificate.";
LOG.error(message, e);
throw new ApkGenerationException(message, e);
}
}
}

@ -0,0 +1,117 @@
/*
* Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package cdm.api.windows.wstep.util;
import java.io.File;
/**
* Constants used throughout the project
*/
public class Constants {
public static class FilePath {
private FilePath() {
throw new AssertionError();
}
public static final String BKS_FILE = "emm_truststore.bks";
public static final String ANDROID_AGENT = "emm-agent-android";
public static final String WSO2CARBON_JKS = "wso2carbon.jks";
public static final String CLIENT_TRUST_JKS = "client-truststore.jks";
public static final String COMMON_UTIL = ANDROID_AGENT + File.separator + "src" +
File.separator + "org" + File.separator + "wso2" +
File.separator + "emm" + File.separator + "agent" +
File.separator + "utils" + File.separator +
"CommonUtilities.java";
public static final String WSO2EMM_JKS = "wso2emm.jks";
public static final String ANDROID_AGENT_RAW = ANDROID_AGENT + File.separator + "res" +
File.separator + "raw" + File.separator;
public static final String ANDROID_AGENT_APK = ANDROID_AGENT + File.separator + "target" +
File.separator + "emm_agent.apk";
public static final String APK_FOLDER = "Apk";
public static final String JKS_FOLDER = "jks";
public static final String BIN_PATH = File.separator + "bin" + File.separator + "mvn";
public static final String WORKING_DIR = "workingDir";
public static final String ZIP_PATH = "zipPath";
}
public static final String ALGORITHM = "RSA";
public static final String PROVIDER = "SC";
public static final String ENCRYPTION = "SHA1withRSA";
public static final String REGISTRATION_AUTHORITY = "RA";
public static final String BKS = "BKS";
public static final String BKS_ALIAS = "cert-alias";
public static final String JKS = "JKS";
public static final String SSL = "SSL";
public static final String ENVIRONMENT_VARIABLE = "MAVEN_HOME";
public static final String ARCHIVE_TYPE = ".zip";
public static final String ACTION = "clean";
public static final String GOAL = "package";
public static final String SERVER_IP_ANDROID = "String SERVER_IP = \"";
public static final String TRUST_STORE_BKS = "String TRUSTSTORE_PASSWORD = \"";
public static class CSRDataKeys {
private CSRDataKeys() {
throw new AssertionError();
}
public static final String COUNTRY_CA = "countryCA";
public static final String STATE_CA = "stateCA";
public static final String LOCALITY_CA = "localityCA";
public static final String ORGANIZATION_CA = "organizationCA";
public static final String ORGANIZATION_UNIT_CA = "organizationUCA";
public static final String DAYS_CA = "daysCA";
public static final String COMMON_NAME_CA = "commonNameCA";
public static final String COUNTRY_RA = "countryRA";
public static final String STATE_RA = "stateRA";
public static final String LOCALITY_RA = "localityRA";
public static final String ORGANIZATION_RA = "organizationRA";
public static final String ORGANIZATION_UNIT_RA = "organizationURA";
public static final String DAYS_RA = "daysRA";
public static final String COMMON_NAME_RA = "commonNameRA";
public static final String COUNTRY_SSL = "countrySSL";
public static final String STATE_SSL = "stateSSL";
public static final String LOCALITY_SSL = "localitySSL";
public static final String ORGANIZATION_SSL = "organizationSSL";
public static final String ORGANIZATION_UNIT_SSL = "organizationUSSL";
public static final String DAYS_SSL = "daysSSL";
public static final String SERVER_IP = "serverIp";
public static final String PASSWORD = "password";
public static final String USERSNAME = "usersname";
public static final String COMPANY = "company";
}
public static class TruststoreKeys {
private TruststoreKeys() {
throw new AssertionError();
}
public static final String PASSWORD_PK12_CA = "passwordPK12CA";
public static final String PASSWORD_PK12_RA = "passwordPK12RA";
public static final String ALIAS_PK12_CA = "aliasPK12CA";
public static final String ALIAS_PK12_RA = "aliasPK12RA";
public static final String PASSWORD_WSO2_EMM_JKS = "passwordWSO2EMMJKS";
public static final String ALIAS__CLIENT_TRUSTSTORE = "aliasClientTruststore";
public static final String PASSWORD_CLIENT_TRUSTSTORE = "passwordClientTruststore";
public static final String ALIAS_WSO2_CARBON = "aliasWSO2Carbon";
public static final String PASSWORD_WSO2_CARBON = "passwordWSO2Carbon";
}
}

@ -0,0 +1,195 @@
/*
* Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package cdm.api.windows.wstep.util;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.codehaus.plexus.util.FileUtils;
import java.io.*;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
/**
* Common file operations such as read, write PEM files and .zip file creation
* are handled by this class. These methods are added to improve reusability of
* commonly used file operations.
*/
public class FileOperator {
private static final Log LOG = LogFactory.getLog(FileOperator.class);
/**
* Copy file from the source path to a destination.
*
* @param source source file path
* @param destination destination file path
* @throws ApkGenerationException
*/
public static void copyFile(String source, String destination)
throws ApkGenerationException {
try {
FileUtils.copyFile(new File(source), new File(destination));
} catch (IOException e) {
String message =
"Cannot find one of the files, while trying to copy file :" + source +
", to its destination: " + destination;
LOG.error(message, e);
throw new ApkGenerationException(message, e);
}
}
/**
* Read a file and returns its content as a {@link String}
*
* @param path of the file to be read.
* @return the content of the file
* @throws ApkGenerationException
*/
public static String readFile(String path) throws ApkGenerationException {
try {
return FileUtils.fileRead(new File(path));
} catch (IOException e) {
String message = "Error reading file " + path;
LOG.error(message, e);
throw new ApkGenerationException(message, e);
}
}
/**
* Write content to a physical file
*
* @param path the destination file path
* @param content data to be saved
* @throws ApkGenerationException
*/
public static void fileWrite(String path, String content) throws ApkGenerationException {
try {
FileUtils.fileWrite(path, content);
} catch (IOException e) {
String message = "Error writing to file " + path;
LOG.error(message, e);
throw new ApkGenerationException(message, e);
}
}
/**
* Creates a zip file from a list of files provided.
*
* @param zipFilePath the path of the final zip file to be created.
* @param files An array of file paths that needs to be added to the zip
* @throws ApkGenerationException
*/
public static void createZip(String zipFilePath, String[] files)
throws ApkGenerationException {
FileOutputStream fileOut;
File fileToCopy;
ZipOutputStream zipOutStream = null;
FileInputStream inputStream = null;
byte[] bytes = new byte[1024];
int count;
int x = 0;
try {
fileOut = new FileOutputStream(zipFilePath);
} catch (FileNotFoundException e) {
String message = "Error opening file " + zipFilePath;
LOG.error(message, e);
throw new ApkGenerationException(message, e);
}
try {
zipOutStream = new ZipOutputStream(fileOut);
for (x = 0; x < files.length; x++) {
fileToCopy = new File(files[x]);
inputStream = new FileInputStream(files[x]);
zipOutStream.putNextEntry(new ZipEntry(fileToCopy.getName()));
while ((count = inputStream.read(bytes)) > 0) {
zipOutStream.write(bytes, 0, count);
}
}
} catch (FileNotFoundException e) {
String message = "Cannot open the file ," + files[x] + " to add to zip.";
LOG.error(message, e);
throw new ApkGenerationException(message, e);
} catch (IOException e) {
String message = "Cannot write file ," + files[x] + " to zip.";
LOG.error(message, e);
throw new ApkGenerationException(message, e);
} finally {
if (inputStream != null) {
try {
inputStream.close();
} catch (IOException e) {
String message = "File error while closing the file, " + files[x];
LOG.warn(message, e);
}
}
if (zipOutStream != null) {
try {
zipOutStream.close();
} catch (IOException e) {
String message = "File error while closing the file, " + zipFilePath;
LOG.warn(message, e);
}
}
}
}
/**
* Get a file input stream when the file name is provided.
*
* @param sourceFile Name of the source file.
* @return the file input stream.
* @throws ApkGenerationException
*/
public static FileInputStream getFileInputStream(String sourceFile)
throws ApkGenerationException {
try {
return new FileInputStream(sourceFile);
} catch (FileNotFoundException e) {
String message = "Cannot open the file ," + sourceFile;
LOG.error(message, e);
throw new ApkGenerationException(message, e);
}
}
/**
* Generates a new folder if it doesn't exist when the path is given.
*
* @param path the folder path that needs to be created
* @throws ApkGenerationException
*/
public static void makeFolder(String path) throws ApkGenerationException {
try {
File file=new File(path);
if(!file.mkdirs()){
String message = "Error when creating directory " + path;
LOG.error(message);
throw new ApkGenerationException(message);
}
} catch (SecurityException e) {
String message = "Error when creating directory " + path;
LOG.error(message, e);
throw new ApkGenerationException(message, e);
}
}
}

@ -0,0 +1,94 @@
/*
* Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package cdm.api.windows.wstep.util;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.security.*;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
/**
* Creation of key stores and injecting certificates to the key stores is
* handled here.
*/
public class KeyStoreGenerator {
private static final Log LOG = LogFactory.getLog(KeyStoreGenerator.class);
/**
* Load/initiate a key store from a provided file.
*
* @param keyStore The destination key store which needs to be loaded.
* @param storePass Password of the key store.
* @param resultFile The source key store file.
* @throws ApkGenerationException
*/
public static void loadToStore(KeyStore keyStore, char[] storePass, String resultFile)
throws ApkGenerationException {
FileInputStream fileInputStream = null;
try {
if (resultFile != null) {
fileInputStream = FileOperator.getFileInputStream(resultFile);
keyStore.load(fileInputStream, storePass);
}
} catch (NoSuchAlgorithmException e) {
String message = Constants.ALGORITHM + " cryptographic algorithm is requested but" +
" it is not available in the environment.";
LOG.error(message, e);
throw new ApkGenerationException(message, e);
} catch (CertificateException e) {
String message = "Error working with certificate related to, " + resultFile;
LOG.error(message, e);
throw new ApkGenerationException(message, e);
} catch (IOException e) {
String message = "File error while working with file, " + resultFile;
LOG.error(message, e);
throw new ApkGenerationException(message, e);
} finally {
try {
if (fileInputStream != null) {
fileInputStream.close();
}
} catch (IOException e) {
String message = "File error while closing the file, " + resultFile;
LOG.error(message, e);
}
}
}
public static KeyStore getKeyStore() throws ApkGenerationException {
try {
return KeyStore.getInstance(Constants.JKS);
} catch (KeyStoreException e) {
String message = "KeyStore error while creating new JKS.";
LOG.error(message, e);
throw new ApkGenerationException(message, e);
}
}
}

@ -0,0 +1,57 @@
/*
* Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package cdm.api.windows.wstep.util;
import javax.xml.namespace.QName;
import javax.xml.ws.handler.MessageContext;
import javax.xml.ws.handler.soap.SOAPHandler;
import javax.xml.ws.handler.soap.SOAPMessageContext;
import java.util.HashSet;
import java.util.Set;
public class PPSRSOApMessageHandler implements SOAPHandler<SOAPMessageContext> {
@Override
public Set<QName> getHeaders() {
final QName securityHeader = new QName(
"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd",
"Security",
"wsse");
final HashSet headers = new HashSet();
headers.add(securityHeader);
System.out.println("CHECKED_HEADER");
return headers;
}
@Override public boolean handleMessage(SOAPMessageContext context) {
return true;
}
@Override public boolean handleFault(SOAPMessageContext context) {
return true;
}
@Override public void close(MessageContext context) {
}
}

@ -0,0 +1,42 @@
/*
* Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package cdm.api.windows.wstep.util;
import org.apache.ws.security.WSPasswordCallback;
import javax.security.auth.callback.Callback;
import javax.security.auth.callback.CallbackHandler;
import javax.security.auth.callback.UnsupportedCallbackException;
import java.io.IOException;
public class PasswordCallbackHandler implements CallbackHandler {
@Override public void handle(Callback[] callbacks)
throws IOException, UnsupportedCallbackException {
WSPasswordCallback pc = (WSPasswordCallback) callbacks[0];
System.out.println("CHECKED_BEFORE_IF_SECURITY");
if ("asok@wso2.com".equals(pc.getIdentifier())) {
System.out.println("CHECKED_IF_SECURITY" + pc.getIdentifier());
pc.setPassword("admin");
return;
}
}
}

@ -0,0 +1,48 @@
package cdm.api.windows.xcep;
import cdm.api.windows.xcep.beans.CACollection;
import cdm.api.windows.xcep.beans.OIDCollection;
import cdm.api.windows.xcep.beans.ObjectFactory;
import cdm.api.windows.xcep.beans.Response;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebResult;
import javax.jws.WebService;
import javax.ws.rs.Consumes;
import javax.ws.rs.POST;
import javax.ws.rs.Produces;
import javax.xml.bind.annotation.XmlSeeAlso;
import javax.xml.ws.Action;
import javax.xml.ws.BindingType;
import javax.xml.ws.RequestWrapper;
import javax.xml.ws.ResponseWrapper;
import javax.xml.ws.soap.SOAPBinding;
/**
* This class was generated by Apache CXF 2.7.3
* 2015-01-11T12:55:46.432+05:30
* Generated source version: 2.7.3
*/
@WebService(targetNamespace = "http://schemas.microsoft.com/windows/pki/2009/01/enrollmentpolicy", name = "IPolicy")
@BindingType(value = SOAPBinding.SOAP12HTTP_BINDING)
@XmlSeeAlso({ ObjectFactory.class })
public interface IPolicy {
@RequestWrapper(localName = "GetPolicies", targetNamespace = "http://schemas.microsoft.com/windows/pki/2009/01/enrollmentpolicy", className = "com.microsoft.schemas.windows.pki._2009._01.enrollmentpolicy.GetPolicies")
@WebMethod(operationName = "GetPolicies")
@ResponseWrapper(localName = "GetPoliciesResponse", targetNamespace = "http://schemas.microsoft.com/windows/pki/2009/01/enrollmentpolicy", className = "com.microsoft.schemas.windows.pki._2009._01.enrollmentpolicy.GetPoliciesResponse")
public void getPolicies(
@WebParam(name = "client", targetNamespace = "http://schemas.microsoft.com/windows/pki/2009/01/enrollmentpolicy")
cdm.api.windows.xcep.beans.Client client,
@WebParam(name = "requestFilter", targetNamespace = "http://schemas.microsoft.com/windows/pki/2009/01/enrollmentpolicy")
cdm.api.windows.xcep.beans.RequestFilter requestFilter,
@WebParam(mode = WebParam.Mode.OUT, name = "response", targetNamespace = "http://schemas.microsoft.com/windows/pki/2009/01/enrollmentpolicy")
javax.xml.ws.Holder<Response> response,
@WebParam(mode = WebParam.Mode.OUT, name = "cAs", targetNamespace = "http://schemas.microsoft.com/windows/pki/2009/01/enrollmentpolicy")
javax.xml.ws.Holder<CACollection> cAs,
@WebParam(mode = WebParam.Mode.OUT, name = "oIDs", targetNamespace = "http://schemas.microsoft.com/windows/pki/2009/01/enrollmentpolicy")
javax.xml.ws.Holder<OIDCollection> oIDs
);
}

@ -0,0 +1,489 @@
package cdm.api.windows.xcep.beans;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAnyElement;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
import org.w3c.dom.Element;
/**
* <p>Java class for Attributes complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="Attributes">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element ref="{http://schemas.microsoft.com/windows/pki/2009/01/enrollmentpolicy}commonName"/>
* &lt;element name="policySchema" type="{http://www.w3.org/2001/XMLSchema}unsignedInt"/>
* &lt;element name="certificateValidity" type="{http://schemas.microsoft.com/windows/pki/2009/01/enrollmentpolicy}CertificateValidity"/>
* &lt;element name="permission" type="{http://schemas.microsoft.com/windows/pki/2009/01/enrollmentpolicy}EnrollmentPermission"/>
* &lt;element name="privateKeyAttributes" type="{http://schemas.microsoft.com/windows/pki/2009/01/enrollmentpolicy}PrivateKeyAttributes"/>
* &lt;element name="revision" type="{http://schemas.microsoft.com/windows/pki/2009/01/enrollmentpolicy}Revision"/>
* &lt;element name="supersededPolicies" type="{http://schemas.microsoft.com/windows/pki/2009/01/enrollmentpolicy}SupersededPolicies"/>
* &lt;element name="privateKeyFlags" type="{http://www.w3.org/2001/XMLSchema}unsignedInt"/>
* &lt;element name="subjectNameFlags" type="{http://www.w3.org/2001/XMLSchema}unsignedInt"/>
* &lt;element name="enrollmentFlags" type="{http://www.w3.org/2001/XMLSchema}unsignedInt"/>
* &lt;element name="generalFlags" type="{http://www.w3.org/2001/XMLSchema}unsignedInt"/>
* &lt;element name="hashAlgorithmOIDReference" type="{http://www.w3.org/2001/XMLSchema}int"/>
* &lt;element name="rARequirements" type="{http://schemas.microsoft.com/windows/pki/2009/01/enrollmentpolicy}RARequirements"/>
* &lt;element name="keyArchivalAttributes" type="{http://schemas.microsoft.com/windows/pki/2009/01/enrollmentpolicy}KeyArchivalAttributes"/>
* &lt;element name="extensions" type="{http://schemas.microsoft.com/windows/pki/2009/01/enrollmentpolicy}ExtensionCollection"/>
* &lt;any processContents='lax' maxOccurs="unbounded" minOccurs="0"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "Attributes", propOrder = {
"commonName",
"policySchema",
"certificateValidity",
"permission",
"privateKeyAttributes",
"revision",
"supersededPolicies",
"privateKeyFlags",
"subjectNameFlags",
"enrollmentFlags",
"generalFlags",
"hashAlgorithmOIDReference",
"raRequirements",
"keyArchivalAttributes",
"extensions",
"any"
})
public class Attributes {
@XmlElement(required = true)
protected String commonName;
@XmlSchemaType(name = "unsignedInt")
protected long policySchema;
@XmlElement(required = true)
protected CertificateValidity certificateValidity;
@XmlElement(required = true)
protected EnrollmentPermission permission;
@XmlElement(required = true)
protected PrivateKeyAttributes privateKeyAttributes;
@XmlElement(required = true)
protected Revision revision;
@XmlElement(required = true, nillable = true)
protected SupersededPolicies supersededPolicies;
@XmlElement(required = true, type = Long.class, nillable = true)
@XmlSchemaType(name = "unsignedInt")
protected Long privateKeyFlags;
@XmlElement(required = true, type = Long.class, nillable = true)
@XmlSchemaType(name = "unsignedInt")
protected Long subjectNameFlags;
@XmlElement(required = true, type = Long.class, nillable = true)
@XmlSchemaType(name = "unsignedInt")
protected Long enrollmentFlags;
@XmlElement(required = true, type = Long.class, nillable = true)
@XmlSchemaType(name = "unsignedInt")
protected Long generalFlags;
@XmlElement(required = true, type = Integer.class, nillable = true)
protected Integer hashAlgorithmOIDReference;
@XmlElement(name = "rARequirements", required = true, nillable = true)
protected RARequirements raRequirements;
@XmlElement(required = true, nillable = true)
protected KeyArchivalAttributes keyArchivalAttributes;
@XmlElement(required = true, nillable = true)
protected ExtensionCollection extensions;
@XmlAnyElement(lax = true)
protected List<Object> any;
/**
* Gets the value of the commonName property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getCommonName() {
return commonName;
}
/**
* Sets the value of the commonName property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setCommonName(String value) {
this.commonName = value;
}
/**
* Gets the value of the policySchema property.
*
*/
public long getPolicySchema() {
return policySchema;
}
/**
* Sets the value of the policySchema property.
*
*/
public void setPolicySchema(long value) {
this.policySchema = value;
}
/**
* Gets the value of the certificateValidity property.
*
* @return
* possible object is
* {@link CertificateValidity }
*
*/
public CertificateValidity getCertificateValidity() {
return certificateValidity;
}
/**
* Sets the value of the certificateValidity property.
*
* @param value
* allowed object is
* {@link CertificateValidity }
*
*/
public void setCertificateValidity(CertificateValidity value) {
this.certificateValidity = value;
}
/**
* Gets the value of the permission property.
*
* @return
* possible object is
* {@link EnrollmentPermission }
*
*/
public EnrollmentPermission getPermission() {
return permission;
}
/**
* Sets the value of the permission property.
*
* @param value
* allowed object is
* {@link EnrollmentPermission }
*
*/
public void setPermission(EnrollmentPermission value) {
this.permission = value;
}
/**
* Gets the value of the privateKeyAttributes property.
*
* @return
* possible object is
* {@link PrivateKeyAttributes }
*
*/
public PrivateKeyAttributes getPrivateKeyAttributes() {
return privateKeyAttributes;
}
/**
* Sets the value of the privateKeyAttributes property.
*
* @param value
* allowed object is
* {@link PrivateKeyAttributes }
*
*/
public void setPrivateKeyAttributes(PrivateKeyAttributes value) {
this.privateKeyAttributes = value;
}
/**
* Gets the value of the revision property.
*
* @return
* possible object is
* {@link Revision }
*
*/
public Revision getRevision() {
return revision;
}
/**
* Sets the value of the revision property.
*
* @param value
* allowed object is
* {@link Revision }
*
*/
public void setRevision(Revision value) {
this.revision = value;
}
/**
* Gets the value of the supersededPolicies property.
*
* @return
* possible object is
* {@link SupersededPolicies }
*
*/
public SupersededPolicies getSupersededPolicies() {
return supersededPolicies;
}
/**
* Sets the value of the supersededPolicies property.
*
* @param value
* allowed object is
* {@link SupersededPolicies }
*
*/
public void setSupersededPolicies(SupersededPolicies value) {
this.supersededPolicies = value;
}
/**
* Gets the value of the privateKeyFlags property.
*
* @return
* possible object is
* {@link Long }
*
*/
public Long getPrivateKeyFlags() {
return privateKeyFlags;
}
/**
* Sets the value of the privateKeyFlags property.
*
* @param value
* allowed object is
* {@link Long }
*
*/
public void setPrivateKeyFlags(Long value) {
this.privateKeyFlags = value;
}
/**
* Gets the value of the subjectNameFlags property.
*
* @return
* possible object is
* {@link Long }
*
*/
public Long getSubjectNameFlags() {
return subjectNameFlags;
}
/**
* Sets the value of the subjectNameFlags property.
*
* @param value
* allowed object is
* {@link Long }
*
*/
public void setSubjectNameFlags(Long value) {
this.subjectNameFlags = value;
}
/**
* Gets the value of the enrollmentFlags property.
*
* @return
* possible object is
* {@link Long }
*
*/
public Long getEnrollmentFlags() {
return enrollmentFlags;
}
/**
* Sets the value of the enrollmentFlags property.
*
* @param value
* allowed object is
* {@link Long }
*
*/
public void setEnrollmentFlags(Long value) {
this.enrollmentFlags = value;
}
/**
* Gets the value of the generalFlags property.
*
* @return
* possible object is
* {@link Long }
*
*/
public Long getGeneralFlags() {
return generalFlags;
}
/**
* Sets the value of the generalFlags property.
*
* @param value
* allowed object is
* {@link Long }
*
*/
public void setGeneralFlags(Long value) {
this.generalFlags = value;
}
/**
* Gets the value of the hashAlgorithmOIDReference property.
*
* @return
* possible object is
* {@link Integer }
*
*/
public Integer getHashAlgorithmOIDReference() {
return hashAlgorithmOIDReference;
}
/**
* Sets the value of the hashAlgorithmOIDReference property.
*
* @param value
* allowed object is
* {@link Integer }
*
*/
public void setHashAlgorithmOIDReference(Integer value) {
this.hashAlgorithmOIDReference = value;
}
/**
* Gets the value of the raRequirements property.
*
* @return
* possible object is
* {@link RARequirements }
*
*/
public RARequirements getRARequirements() {
return raRequirements;
}
/**
* Sets the value of the raRequirements property.
*
* @param value
* allowed object is
* {@link RARequirements }
*
*/
public void setRARequirements(RARequirements value) {
this.raRequirements = value;
}
/**
* Gets the value of the keyArchivalAttributes property.
*
* @return
* possible object is
* {@link KeyArchivalAttributes }
*
*/
public KeyArchivalAttributes getKeyArchivalAttributes() {
return keyArchivalAttributes;
}
/**
* Sets the value of the keyArchivalAttributes property.
*
* @param value
* allowed object is
* {@link KeyArchivalAttributes }
*
*/
public void setKeyArchivalAttributes(KeyArchivalAttributes value) {
this.keyArchivalAttributes = value;
}
/**
* Gets the value of the extensions property.
*
* @return
* possible object is
* {@link ExtensionCollection }
*
*/
public ExtensionCollection getExtensions() {
return extensions;
}
/**
* Sets the value of the extensions property.
*
* @param value
* allowed object is
* {@link ExtensionCollection }
*
*/
public void setExtensions(ExtensionCollection value) {
this.extensions = value;
}
/**
* Gets the value of the any property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the any property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getAny().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link Object }
* {@link Element }
*
*
*/
public List<Object> getAny() {
if (any == null) {
any = new ArrayList<Object>();
}
return this.any;
}
}

@ -0,0 +1,165 @@
package cdm.api.windows.xcep.beans;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAnyElement;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
import org.w3c.dom.Element;
/**
* <p>Java class for CA complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="CA">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="uris" type="{http://schemas.microsoft.com/windows/pki/2009/01/enrollmentpolicy}CAURICollection"/>
* &lt;element name="certificate" type="{http://www.w3.org/2001/XMLSchema}base64Binary"/>
* &lt;element name="enrollPermission" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
* &lt;element name="cAReferenceID" type="{http://www.w3.org/2001/XMLSchema}int"/>
* &lt;any processContents='lax' maxOccurs="unbounded" minOccurs="0"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "CA", propOrder = {
"uris",
"certificate",
"enrollPermission",
"caReferenceID",
"any"
})
public class CA {
@XmlElement(required = true)
protected CAURICollection uris;
@XmlElement(required = true)
protected byte[] certificate;
protected boolean enrollPermission;
@XmlElement(name = "cAReferenceID")
protected int caReferenceID;
@XmlAnyElement(lax = true)
protected List<Object> any;
/**
* Gets the value of the uris property.
*
* @return
* possible object is
* {@link CAURICollection }
*
*/
public CAURICollection getUris() {
return uris;
}
/**
* Sets the value of the uris property.
*
* @param value
* allowed object is
* {@link CAURICollection }
*
*/
public void setUris(CAURICollection value) {
this.uris = value;
}
/**
* Gets the value of the certificate property.
*
* @return
* possible object is
* byte[]
*/
public byte[] getCertificate() {
return certificate;
}
/**
* Sets the value of the certificate property.
*
* @param value
* allowed object is
* byte[]
*/
public void setCertificate(byte[] value) {
this.certificate = value;
}
/**
* Gets the value of the enrollPermission property.
*
*/
public boolean isEnrollPermission() {
return enrollPermission;
}
/**
* Sets the value of the enrollPermission property.
*
*/
public void setEnrollPermission(boolean value) {
this.enrollPermission = value;
}
/**
* Gets the value of the caReferenceID property.
*
*/
public int getCAReferenceID() {
return caReferenceID;
}
/**
* Sets the value of the caReferenceID property.
*
*/
public void setCAReferenceID(int value) {
this.caReferenceID = value;
}
/**
* Gets the value of the any property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the any property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getAny().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link Object }
* {@link Element }
*
*
*/
public List<Object> getAny() {
if (any == null) {
any = new ArrayList<Object>();
}
return this.any;
}
}

@ -0,0 +1,69 @@
package cdm.api.windows.xcep.beans;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for CACollection complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="CACollection">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="cA" type="{http://schemas.microsoft.com/windows/pki/2009/01/enrollmentpolicy}CA" maxOccurs="unbounded"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "CACollection", propOrder = {
"ca"
})
public class CACollection {
@XmlElement(name = "cA", required = true)
protected List<CA> ca;
/**
* Gets the value of the ca property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the ca property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getCA().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link CA }
*
*
*/
public List<CA> getCA() {
if (ca == null) {
ca = new ArrayList<CA>();
}
return this.ca;
}
}

@ -0,0 +1,69 @@
package cdm.api.windows.xcep.beans;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for CAReferenceCollection complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="CAReferenceCollection">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="cAReference" type="{http://www.w3.org/2001/XMLSchema}int" maxOccurs="unbounded"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "CAReferenceCollection", propOrder = {
"caReference"
})
public class CAReferenceCollection {
@XmlElement(name = "cAReference", type = Integer.class)
protected List<Integer> caReference;
/**
* Gets the value of the caReference property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the caReference property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getCAReference().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link Integer }
*
*
*/
public List<Integer> getCAReference() {
if (caReference == null) {
caReference = new ArrayList<Integer>();
}
return this.caReference;
}
}

@ -0,0 +1,170 @@
package cdm.api.windows.xcep.beans;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAnyElement;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
import org.w3c.dom.Element;
/**
* <p>Java class for CAURI complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="CAURI">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="clientAuthentication" type="{http://www.w3.org/2001/XMLSchema}unsignedInt"/>
* &lt;element name="uri" type="{http://www.w3.org/2001/XMLSchema}anyURI"/>
* &lt;element name="priority" type="{http://www.w3.org/2001/XMLSchema}unsignedInt"/>
* &lt;element name="renewalOnly" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
* &lt;any processContents='lax' maxOccurs="unbounded" minOccurs="0"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "CAURI", propOrder = {
"clientAuthentication",
"uri",
"priority",
"renewalOnly",
"any"
})
public class CAURI {
@XmlSchemaType(name = "unsignedInt")
protected long clientAuthentication;
@XmlElement(required = true)
@XmlSchemaType(name = "anyURI")
protected String uri;
@XmlElement(required = true, type = Long.class, nillable = true)
@XmlSchemaType(name = "unsignedInt")
protected Long priority;
protected boolean renewalOnly;
@XmlAnyElement(lax = true)
protected List<Object> any;
/**
* Gets the value of the clientAuthentication property.
*
*/
public long getClientAuthentication() {
return clientAuthentication;
}
/**
* Sets the value of the clientAuthentication property.
*
*/
public void setClientAuthentication(long value) {
this.clientAuthentication = value;
}
/**
* Gets the value of the uri property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getUri() {
return uri;
}
/**
* Sets the value of the uri property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setUri(String value) {
this.uri = value;
}
/**
* Gets the value of the priority property.
*
* @return
* possible object is
* {@link Long }
*
*/
public Long getPriority() {
return priority;
}
/**
* Sets the value of the priority property.
*
* @param value
* allowed object is
* {@link Long }
*
*/
public void setPriority(Long value) {
this.priority = value;
}
/**
* Gets the value of the renewalOnly property.
*
*/
public boolean isRenewalOnly() {
return renewalOnly;
}
/**
* Sets the value of the renewalOnly property.
*
*/
public void setRenewalOnly(boolean value) {
this.renewalOnly = value;
}
/**
* Gets the value of the any property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the any property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getAny().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link Object }
* {@link Element }
*
*
*/
public List<Object> getAny() {
if (any == null) {
any = new ArrayList<Object>();
}
return this.any;
}
}

@ -0,0 +1,69 @@
package cdm.api.windows.xcep.beans;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for CAURICollection complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="CAURICollection">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="cAURI" type="{http://schemas.microsoft.com/windows/pki/2009/01/enrollmentpolicy}CAURI" maxOccurs="unbounded"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "CAURICollection", propOrder = {
"cauri"
})
public class CAURICollection {
@XmlElement(name = "cAURI", required = true)
protected List<CAURI> cauri;
/**
* Gets the value of the cauri property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the cauri property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getCAURI().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link CAURI }
*
*
*/
public List<CAURI> getCAURI() {
if (cauri == null) {
cauri = new ArrayList<CAURI>();
}
return this.cauri;
}
}

@ -0,0 +1,147 @@
package cdm.api.windows.xcep.beans;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAnyElement;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
import org.w3c.dom.Element;
/**
* <p>Java class for CertificateEnrollmentPolicy complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="CertificateEnrollmentPolicy">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="policyOIDReference" type="{http://www.w3.org/2001/XMLSchema}int"/>
* &lt;element name="cAs" type="{http://schemas.microsoft.com/windows/pki/2009/01/enrollmentpolicy}CAReferenceCollection"/>
* &lt;element name="attributes" type="{http://schemas.microsoft.com/windows/pki/2009/01/enrollmentpolicy}Attributes"/>
* &lt;any processContents='lax' maxOccurs="unbounded" minOccurs="0"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "CertificateEnrollmentPolicy", propOrder = {
"policyOIDReference",
"cAs",
"attributes",
"any"
})
public class CertificateEnrollmentPolicy {
protected int policyOIDReference;
@XmlElement(required = true, nillable = true)
protected CAReferenceCollection cAs;
@XmlElement(required = true)
protected Attributes attributes;
@XmlAnyElement(lax = true)
protected List<Object> any;
/**
* Gets the value of the policyOIDReference property.
*
*/
public int getPolicyOIDReference() {
return policyOIDReference;
}
/**
* Sets the value of the policyOIDReference property.
*
*/
public void setPolicyOIDReference(int value) {
this.policyOIDReference = value;
}
/**
* Gets the value of the cAs property.
*
* @return
* possible object is
* {@link CAReferenceCollection }
*
*/
public CAReferenceCollection getCAs() {
return cAs;
}
/**
* Sets the value of the cAs property.
*
* @param value
* allowed object is
* {@link CAReferenceCollection }
*
*/
public void setCAs(CAReferenceCollection value) {
this.cAs = value;
}
/**
* Gets the value of the attributes property.
*
* @return
* possible object is
* {@link Attributes }
*
*/
public Attributes getAttributes() {
return attributes;
}
/**
* Sets the value of the attributes property.
*
* @param value
* allowed object is
* {@link Attributes }
*
*/
public void setAttributes(Attributes value) {
this.attributes = value;
}
/**
* Gets the value of the any property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the any property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getAny().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link Object }
* {@link Element }
*
*
*/
public List<Object> getAny() {
if (any == null) {
any = new ArrayList<Object>();
}
return this.any;
}
}

@ -0,0 +1,94 @@
package cdm.api.windows.xcep.beans;
import java.math.BigInteger;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for CertificateValidity complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="CertificateValidity">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="validityPeriodSeconds" type="{http://www.w3.org/2001/XMLSchema}unsignedLong"/>
* &lt;element name="renewalPeriodSeconds" type="{http://www.w3.org/2001/XMLSchema}unsignedLong"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "CertificateValidity", propOrder = {
"validityPeriodSeconds",
"renewalPeriodSeconds"
})
public class CertificateValidity {
@XmlElement(required = true)
@XmlSchemaType(name = "unsignedLong")
protected BigInteger validityPeriodSeconds;
@XmlElement(required = true)
@XmlSchemaType(name = "unsignedLong")
protected BigInteger renewalPeriodSeconds;
/**
* Gets the value of the validityPeriodSeconds property.
*
* @return
* possible object is
* {@link BigInteger }
*
*/
public BigInteger getValidityPeriodSeconds() {
return validityPeriodSeconds;
}
/**
* Sets the value of the validityPeriodSeconds property.
*
* @param value
* allowed object is
* {@link BigInteger }
*
*/
public void setValidityPeriodSeconds(BigInteger value) {
this.validityPeriodSeconds = value;
}
/**
* Gets the value of the renewalPeriodSeconds property.
*
* @return
* possible object is
* {@link BigInteger }
*
*/
public BigInteger getRenewalPeriodSeconds() {
return renewalPeriodSeconds;
}
/**
* Sets the value of the renewalPeriodSeconds property.
*
* @param value
* allowed object is
* {@link BigInteger }
*
*/
public void setRenewalPeriodSeconds(BigInteger value) {
this.renewalPeriodSeconds = value;
}
}

@ -0,0 +1,135 @@
package cdm.api.windows.xcep.beans;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAnyElement;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import javax.xml.datatype.XMLGregorianCalendar;
import org.w3c.dom.Element;
/**
* <p>Java class for Client complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="Client">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="lastUpdate" type="{http://www.w3.org/2001/XMLSchema}dateTime"/>
* &lt;element name="preferredLanguage" type="{http://www.w3.org/2001/XMLSchema}language"/>
* &lt;any processContents='lax' maxOccurs="unbounded" minOccurs="0"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "Client", propOrder = {
"lastUpdate",
"preferredLanguage",
"any"
})
public class Client {
@XmlElement(required = true, nillable = true)
@XmlSchemaType(name = "dateTime")
protected XMLGregorianCalendar lastUpdate;
@XmlElement(required = true, nillable = true)
@XmlJavaTypeAdapter(CollapsedStringAdapter.class)
@XmlSchemaType(name = "language")
protected String preferredLanguage;
@XmlAnyElement(lax = true)
protected List<Object> any;
/**
* Gets the value of the lastUpdate property.
*
* @return
* possible object is
* {@link XMLGregorianCalendar }
*
*/
public XMLGregorianCalendar getLastUpdate() {
return lastUpdate;
}
/**
* Sets the value of the lastUpdate property.
*
* @param value
* allowed object is
* {@link XMLGregorianCalendar }
*
*/
public void setLastUpdate(XMLGregorianCalendar value) {
this.lastUpdate = value;
}
/**
* Gets the value of the preferredLanguage property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getPreferredLanguage() {
return preferredLanguage;
}
/**
* Sets the value of the preferredLanguage property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setPreferredLanguage(String value) {
this.preferredLanguage = value;
}
/**
* Gets the value of the any property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the any property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getAny().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link Object }
* {@link Element }
*
*
*/
public List<Object> getAny() {
if (any == null) {
any = new ArrayList<Object>();
}
return this.any;
}
}

@ -0,0 +1,69 @@
package cdm.api.windows.xcep.beans;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for CryptoProviders complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="CryptoProviders">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="provider" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "CryptoProviders", propOrder = {
"provider"
})
public class CryptoProviders {
@XmlElement(required = true)
protected List<String> provider;
/**
* Gets the value of the provider property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the provider property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getProvider().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link String }
*
*
*/
public List<String> getProvider() {
if (provider == null) {
provider = new ArrayList<String>();
}
return this.provider;
}
}

@ -0,0 +1,71 @@
package cdm.api.windows.xcep.beans;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for EnrollmentPermission complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="EnrollmentPermission">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="enroll" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
* &lt;element name="autoEnroll" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "EnrollmentPermission", propOrder = {
"enroll",
"autoEnroll"
})
public class EnrollmentPermission {
protected boolean enroll;
protected boolean autoEnroll;
/**
* Gets the value of the enroll property.
*
*/
public boolean isEnroll() {
return enroll;
}
/**
* Sets the value of the enroll property.
*
*/
public void setEnroll(boolean value) {
this.enroll = value;
}
/**
* Gets the value of the autoEnroll property.
*
*/
public boolean isAutoEnroll() {
return autoEnroll;
}
/**
* Sets the value of the autoEnroll property.
*
*/
public void setAutoEnroll(boolean value) {
this.autoEnroll = value;
}
}

@ -0,0 +1,99 @@
package cdm.api.windows.xcep.beans;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for Extension complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="Extension">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="oIDReference" type="{http://www.w3.org/2001/XMLSchema}int"/>
* &lt;element name="critical" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
* &lt;element name="value" type="{http://www.w3.org/2001/XMLSchema}base64Binary"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "Extension", propOrder = {
"oidReference",
"critical",
"value"
})
public class Extension {
@XmlElement(name = "oIDReference")
protected int oidReference;
protected boolean critical;
@XmlElement(required = true, nillable = true)
protected byte[] value;
/**
* Gets the value of the oidReference property.
*
*/
public int getOIDReference() {
return oidReference;
}
/**
* Sets the value of the oidReference property.
*
*/
public void setOIDReference(int value) {
this.oidReference = value;
}
/**
* Gets the value of the critical property.
*
*/
public boolean isCritical() {
return critical;
}
/**
* Sets the value of the critical property.
*
*/
public void setCritical(boolean value) {
this.critical = value;
}
/**
* Gets the value of the value property.
*
* @return
* possible object is
* byte[]
*/
public byte[] getValue() {
return value;
}
/**
* Sets the value of the value property.
*
* @param value
* allowed object is
* byte[]
*/
public void setValue(byte[] value) {
this.value = value;
}
}

@ -0,0 +1,69 @@
package cdm.api.windows.xcep.beans;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for ExtensionCollection complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="ExtensionCollection">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="extension" type="{http://schemas.microsoft.com/windows/pki/2009/01/enrollmentpolicy}Extension" maxOccurs="unbounded"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "ExtensionCollection", propOrder = {
"extension"
})
public class ExtensionCollection {
@XmlElement(required = true)
protected List<Extension> extension;
/**
* Gets the value of the extension property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the extension property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getExtension().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link Extension }
*
*
*/
public List<Extension> getExtension() {
if (extension == null) {
extension = new ArrayList<Extension>();
}
return this.extension;
}
}

@ -0,0 +1,69 @@
package cdm.api.windows.xcep.beans;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for FilterOIDCollection complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="FilterOIDCollection">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="oid" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "FilterOIDCollection", propOrder = {
"oid"
})
public class FilterOIDCollection {
@XmlElement(required = true)
protected List<String> oid;
/**
* Gets the value of the oid property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the oid property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getOid().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link String }
*
*
*/
public List<String> getOid() {
if (oid == null) {
oid = new ArrayList<String>();
}
return this.oid;
}
}

@ -0,0 +1,92 @@
package cdm.api.windows.xcep.beans;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType>
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="client" type="{http://schemas.microsoft.com/windows/pki/2009/01/enrollmentpolicy}Client"/>
* &lt;element name="requestFilter" type="{http://schemas.microsoft.com/windows/pki/2009/01/enrollmentpolicy}RequestFilter"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"client",
"requestFilter"
})
@XmlRootElement(name = "GetPolicies")
public class GetPolicies {
@XmlElement(required = true)
protected Client client;
@XmlElement(required = true, nillable = true)
protected RequestFilter requestFilter;
/**
* Gets the value of the client property.
*
* @return
* possible object is
* {@link Client }
*
*/
public Client getClient() {
return client;
}
/**
* Sets the value of the client property.
*
* @param value
* allowed object is
* {@link Client }
*
*/
public void setClient(Client value) {
this.client = value;
}
/**
* Gets the value of the requestFilter property.
*
* @return
* possible object is
* {@link RequestFilter }
*
*/
public RequestFilter getRequestFilter() {
return requestFilter;
}
/**
* Sets the value of the requestFilter property.
*
* @param value
* allowed object is
* {@link RequestFilter }
*
*/
public void setRequestFilter(RequestFilter value) {
this.requestFilter = value;
}
}

@ -0,0 +1,120 @@
package cdm.api.windows.xcep.beans;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType>
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="response" type="{http://schemas.microsoft.com/windows/pki/2009/01/enrollmentpolicy}Response"/>
* &lt;element name="cAs" type="{http://schemas.microsoft.com/windows/pki/2009/01/enrollmentpolicy}CACollection"/>
* &lt;element name="oIDs" type="{http://schemas.microsoft.com/windows/pki/2009/01/enrollmentpolicy}OIDCollection"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"response",
"cAs",
"oiDs"
})
@XmlRootElement(name = "GetPoliciesResponse")
public class GetPoliciesResponse {
@XmlElement(required = true, nillable = true)
protected Response response;
@XmlElement(required = true, nillable = true)
protected CACollection cAs;
@XmlElement(name = "oIDs", required = true, nillable = true)
protected OIDCollection oiDs;
/**
* Gets the value of the response property.
*
* @return
* possible object is
* {@link Response }
*
*/
public Response getResponse() {
return response;
}
/**
* Sets the value of the response property.
*
* @param value
* allowed object is
* {@link Response }
*
*/
public void setResponse(Response value) {
this.response = value;
}
/**
* Gets the value of the cAs property.
*
* @return
* possible object is
* {@link CACollection }
*
*/
public CACollection getCAs() {
return cAs;
}
/**
* Sets the value of the cAs property.
*
* @param value
* allowed object is
* {@link CACollection }
*
*/
public void setCAs(CACollection value) {
this.cAs = value;
}
/**
* Gets the value of the oiDs property.
*
* @return
* possible object is
* {@link OIDCollection }
*
*/
public OIDCollection getOIDs() {
return oiDs;
}
/**
* Sets the value of the oiDs property.
*
* @param value
* allowed object is
* {@link OIDCollection }
*
*/
public void setOIDs(OIDCollection value) {
this.oiDs = value;
}
}

@ -0,0 +1,73 @@
package cdm.api.windows.xcep.beans;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for KeyArchivalAttributes complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="KeyArchivalAttributes">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="symmetricAlgorithmOIDReference" type="{http://www.w3.org/2001/XMLSchema}int"/>
* &lt;element name="symmetricAlgorithmKeyLength" type="{http://www.w3.org/2001/XMLSchema}unsignedInt"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "KeyArchivalAttributes", propOrder = {
"symmetricAlgorithmOIDReference",
"symmetricAlgorithmKeyLength"
})
public class KeyArchivalAttributes {
protected int symmetricAlgorithmOIDReference;
@XmlSchemaType(name = "unsignedInt")
protected long symmetricAlgorithmKeyLength;
/**
* Gets the value of the symmetricAlgorithmOIDReference property.
*
*/
public int getSymmetricAlgorithmOIDReference() {
return symmetricAlgorithmOIDReference;
}
/**
* Sets the value of the symmetricAlgorithmOIDReference property.
*
*/
public void setSymmetricAlgorithmOIDReference(int value) {
this.symmetricAlgorithmOIDReference = value;
}
/**
* Gets the value of the symmetricAlgorithmKeyLength property.
*
*/
public long getSymmetricAlgorithmKeyLength() {
return symmetricAlgorithmKeyLength;
}
/**
* Sets the value of the symmetricAlgorithmKeyLength property.
*
*/
public void setSymmetricAlgorithmKeyLength(long value) {
this.symmetricAlgorithmKeyLength = value;
}
}

@ -0,0 +1,169 @@
package cdm.api.windows.xcep.beans;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAnyElement;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
import org.w3c.dom.Element;
/**
* <p>Java class for OID complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="OID">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="value" type="{http://www.w3.org/2001/XMLSchema}string"/>
* &lt;element name="group" type="{http://www.w3.org/2001/XMLSchema}unsignedInt"/>
* &lt;element name="oIDReferenceID" type="{http://www.w3.org/2001/XMLSchema}int"/>
* &lt;element name="defaultName" type="{http://www.w3.org/2001/XMLSchema}string"/>
* &lt;any processContents='lax' maxOccurs="unbounded" minOccurs="0"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "OID", propOrder = {
"value",
"group",
"oidReferenceID",
"defaultName",
"any"
})
public class OID {
@XmlElement(required = true)
protected String value;
@XmlSchemaType(name = "unsignedInt")
protected long group;
@XmlElement(name = "oIDReferenceID")
protected int oidReferenceID;
@XmlElement(required = true, nillable = true)
protected String defaultName;
@XmlAnyElement(lax = true)
protected List<Object> any;
/**
* Gets the value of the value property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getValue() {
return value;
}
/**
* Sets the value of the value property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setValue(String value) {
this.value = value;
}
/**
* Gets the value of the group property.
*
*/
public long getGroup() {
return group;
}
/**
* Sets the value of the group property.
*
*/
public void setGroup(long value) {
this.group = value;
}
/**
* Gets the value of the oidReferenceID property.
*
*/
public int getOIDReferenceID() {
return oidReferenceID;
}
/**
* Sets the value of the oidReferenceID property.
*
*/
public void setOIDReferenceID(int value) {
this.oidReferenceID = value;
}
/**
* Gets the value of the defaultName property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getDefaultName() {
return defaultName;
}
/**
* Sets the value of the defaultName property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setDefaultName(String value) {
this.defaultName = value;
}
/**
* Gets the value of the any property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the any property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getAny().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link Object }
* {@link Element }
*
*
*/
public List<Object> getAny() {
if (any == null) {
any = new ArrayList<Object>();
}
return this.any;
}
}

@ -0,0 +1,69 @@
package cdm.api.windows.xcep.beans;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for OIDCollection complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="OIDCollection">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="oID" type="{http://schemas.microsoft.com/windows/pki/2009/01/enrollmentpolicy}OID" maxOccurs="unbounded"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "OIDCollection", propOrder = {
"oid"
})
public class OIDCollection {
@XmlElement(name = "oID", required = true)
protected List<OID> oid;
/**
* Gets the value of the oid property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the oid property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getOID().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link OID }
*
*
*/
public List<OID> getOID() {
if (oid == null) {
oid = new ArrayList<OID>();
}
return this.oid;
}
}

@ -0,0 +1,69 @@
package cdm.api.windows.xcep.beans;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for OIDReferenceCollection complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="OIDReferenceCollection">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="oIDReference" type="{http://www.w3.org/2001/XMLSchema}int" maxOccurs="unbounded"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "OIDReferenceCollection", propOrder = {
"oidReference"
})
public class OIDReferenceCollection {
@XmlElement(name = "oIDReference", type = Integer.class)
protected List<Integer> oidReference;
/**
* Gets the value of the oidReference property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the oidReference property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getOIDReference().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link Integer }
*
*
*/
public List<Integer> getOIDReference() {
if (oidReference == null) {
oidReference = new ArrayList<Integer>();
}
return this.oidReference;
}
}

@ -0,0 +1,261 @@
package cdm.api.windows.xcep.beans;
import javax.xml.bind.JAXBElement;
import javax.xml.bind.annotation.XmlElementDecl;
import javax.xml.bind.annotation.XmlRegistry;
import javax.xml.namespace.QName;
/**
* This object contains factory methods for each
* Java content interface and Java element interface
* generated in the com.microsoft.schemas.windows.pki._2009._01.enrollmentpolicy package.
* <p>An ObjectFactory allows you to programatically
* construct new instances of the Java representation
* for XML content. The Java representation of XML
* content can consist of schema derived interfaces
* and classes representing the binding of schema
* type definitions, element declarations and model
* groups. Factory methods for each of these are
* provided in this class.
*
*/
@XmlRegistry
public class ObjectFactory {
private final static QName _CommonName_QNAME = new QName("http://schemas.microsoft.com/windows/pki/2009/01/enrollmentpolicy", "commonName");
/**
* Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: com.microsoft.schemas.windows.pki._2009._01.enrollmentpolicy
*
*/
public ObjectFactory() {
}
/**
* Create an instance of {@link GetPolicies }
*
*/
public GetPolicies createGetPolicies() {
return new GetPolicies();
}
/**
* Create an instance of {@link Client }
*
*/
public Client createClient() {
return new Client();
}
/**
* Create an instance of {@link RequestFilter }
*
*/
public RequestFilter createRequestFilter() {
return new RequestFilter();
}
/**
* Create an instance of {@link GetPoliciesResponse }
*
*/
public GetPoliciesResponse createGetPoliciesResponse() {
return new GetPoliciesResponse();
}
/**
* Create an instance of {@link Response }
*
*/
public Response createResponse() {
return new Response();
}
/**
* Create an instance of {@link CACollection }
*
*/
public CACollection createCACollection() {
return new CACollection();
}
/**
* Create an instance of {@link OIDCollection }
*
*/
public OIDCollection createOIDCollection() {
return new OIDCollection();
}
/**
* Create an instance of {@link SupersededPolicies }
*
*/
public SupersededPolicies createSupersededPolicies() {
return new SupersededPolicies();
}
/**
* Create an instance of {@link OID }
*
*/
public OID createOID() {
return new OID();
}
/**
* Create an instance of {@link ExtensionCollection }
*
*/
public ExtensionCollection createExtensionCollection() {
return new ExtensionCollection();
}
/**
* Create an instance of {@link Attributes }
*
*/
public Attributes createAttributes() {
return new Attributes();
}
/**
* Create an instance of {@link EnrollmentPermission }
*
*/
public EnrollmentPermission createEnrollmentPermission() {
return new EnrollmentPermission();
}
/**
* Create an instance of {@link CAReferenceCollection }
*
*/
public CAReferenceCollection createCAReferenceCollection() {
return new CAReferenceCollection();
}
/**
* Create an instance of {@link CertificateValidity }
*
*/
public CertificateValidity createCertificateValidity() {
return new CertificateValidity();
}
/**
* Create an instance of {@link CAURICollection }
*
*/
public CAURICollection createCAURICollection() {
return new CAURICollection();
}
/**
* Create an instance of {@link PolicyCollection }
*
*/
public PolicyCollection createPolicyCollection() {
return new PolicyCollection();
}
/**
* Create an instance of {@link Revision }
*
*/
public Revision createRevision() {
return new Revision();
}
/**
* Create an instance of {@link OIDReferenceCollection }
*
*/
public OIDReferenceCollection createOIDReferenceCollection() {
return new OIDReferenceCollection();
}
/**
* Create an instance of {@link CA }
*
*/
public CA createCA() {
return new CA();
}
/**
* Create an instance of {@link CertificateEnrollmentPolicy }
*
*/
public CertificateEnrollmentPolicy createCertificateEnrollmentPolicy() {
return new CertificateEnrollmentPolicy();
}
/**
* Create an instance of {@link CryptoProviders }
*
*/
public CryptoProviders createCryptoProviders() {
return new CryptoProviders();
}
/**
* Create an instance of {@link Extension }
*
*/
public Extension createExtension() {
return new Extension();
}
/**
* Create an instance of {@link FilterOIDCollection }
*
*/
public FilterOIDCollection createFilterOIDCollection() {
return new FilterOIDCollection();
}
/**
* Create an instance of {@link CAURI }
*
*/
public CAURI createCAURI() {
return new CAURI();
}
/**
* Create an instance of {@link RARequirements }
*
*/
public RARequirements createRARequirements() {
return new RARequirements();
}
/**
* Create an instance of {@link PrivateKeyAttributes }
*
*/
public PrivateKeyAttributes createPrivateKeyAttributes() {
return new PrivateKeyAttributes();
}
/**
* Create an instance of {@link KeyArchivalAttributes }
*
*/
public KeyArchivalAttributes createKeyArchivalAttributes() {
return new KeyArchivalAttributes();
}
/**
* Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}}
*
*/
@XmlElementDecl(namespace = "http://schemas.microsoft.com/windows/pki/2009/01/enrollmentpolicy", name = "commonName")
public JAXBElement<String> createCommonName(String value) {
return new JAXBElement<String>(_CommonName_QNAME, String.class, null, value);
}
}

@ -0,0 +1,69 @@
package cdm.api.windows.xcep.beans;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for PolicyCollection complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="PolicyCollection">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="policy" type="{http://schemas.microsoft.com/windows/pki/2009/01/enrollmentpolicy}CertificateEnrollmentPolicy" maxOccurs="unbounded"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "PolicyCollection", propOrder = {
"policy"
})
public class PolicyCollection {
@XmlElement(required = true)
protected List<CertificateEnrollmentPolicy> policy;
/**
* Gets the value of the policy property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the policy property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getPolicy().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link CertificateEnrollmentPolicy }
*
*
*/
public List<CertificateEnrollmentPolicy> getPolicy() {
if (policy == null) {
policy = new ArrayList<CertificateEnrollmentPolicy>();
}
return this.policy;
}
}

@ -0,0 +1,197 @@
package cdm.api.windows.xcep.beans;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for PrivateKeyAttributes complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="PrivateKeyAttributes">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="minimalKeyLength" type="{http://www.w3.org/2001/XMLSchema}unsignedInt"/>
* &lt;element name="keySpec" type="{http://www.w3.org/2001/XMLSchema}unsignedInt"/>
* &lt;element name="keyUsageProperty" type="{http://www.w3.org/2001/XMLSchema}unsignedInt"/>
* &lt;element name="permissions" type="{http://www.w3.org/2001/XMLSchema}string"/>
* &lt;element name="algorithmOIDReference" type="{http://www.w3.org/2001/XMLSchema}int"/>
* &lt;element name="cryptoProviders" type="{http://schemas.microsoft.com/windows/pki/2009/01/enrollmentpolicy}CryptoProviders"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "PrivateKeyAttributes", propOrder = {
"minimalKeyLength",
"keySpec",
"keyUsageProperty",
"permissions",
"algorithmOIDReference",
"cryptoProviders"
})
public class PrivateKeyAttributes {
@XmlSchemaType(name = "unsignedInt")
protected long minimalKeyLength;
@XmlElement(required = true, type = Long.class, nillable = true)
@XmlSchemaType(name = "unsignedInt")
protected Long keySpec;
@XmlElement(required = true, type = Long.class, nillable = true)
@XmlSchemaType(name = "unsignedInt")
protected Long keyUsageProperty;
@XmlElement(required = true, nillable = true)
protected String permissions;
@XmlElement(required = true, type = Integer.class, nillable = true)
protected Integer algorithmOIDReference;
@XmlElement(required = true, nillable = true)
protected CryptoProviders cryptoProviders;
/**
* Gets the value of the minimalKeyLength property.
*
*/
public long getMinimalKeyLength() {
return minimalKeyLength;
}
/**
* Sets the value of the minimalKeyLength property.
*
*/
public void setMinimalKeyLength(long value) {
this.minimalKeyLength = value;
}
/**
* Gets the value of the keySpec property.
*
* @return
* possible object is
* {@link Long }
*
*/
public Long getKeySpec() {
return keySpec;
}
/**
* Sets the value of the keySpec property.
*
* @param value
* allowed object is
* {@link Long }
*
*/
public void setKeySpec(Long value) {
this.keySpec = value;
}
/**
* Gets the value of the keyUsageProperty property.
*
* @return
* possible object is
* {@link Long }
*
*/
public Long getKeyUsageProperty() {
return keyUsageProperty;
}
/**
* Sets the value of the keyUsageProperty property.
*
* @param value
* allowed object is
* {@link Long }
*
*/
public void setKeyUsageProperty(Long value) {
this.keyUsageProperty = value;
}
/**
* Gets the value of the permissions property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getPermissions() {
return permissions;
}
/**
* Sets the value of the permissions property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setPermissions(String value) {
this.permissions = value;
}
/**
* Gets the value of the algorithmOIDReference property.
*
* @return
* possible object is
* {@link Integer }
*
*/
public Integer getAlgorithmOIDReference() {
return algorithmOIDReference;
}
/**
* Sets the value of the algorithmOIDReference property.
*
* @param value
* allowed object is
* {@link Integer }
*
*/
public void setAlgorithmOIDReference(Integer value) {
this.algorithmOIDReference = value;
}
/**
* Gets the value of the cryptoProviders property.
*
* @return
* possible object is
* {@link CryptoProviders }
*
*/
public CryptoProviders getCryptoProviders() {
return cryptoProviders;
}
/**
* Sets the value of the cryptoProviders property.
*
* @param value
* allowed object is
* {@link CryptoProviders }
*
*/
public void setCryptoProviders(CryptoProviders value) {
this.cryptoProviders = value;
}
}

@ -0,0 +1,112 @@
package cdm.api.windows.xcep.beans;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for RARequirements complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="RARequirements">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="rASignatures" type="{http://www.w3.org/2001/XMLSchema}unsignedInt"/>
* &lt;element name="rAEKUs" type="{http://schemas.microsoft.com/windows/pki/2009/01/enrollmentpolicy}OIDReferenceCollection"/>
* &lt;element name="rAPolicies" type="{http://schemas.microsoft.com/windows/pki/2009/01/enrollmentpolicy}OIDReferenceCollection"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "RARequirements", propOrder = {
"raSignatures",
"raekUs",
"raPolicies"
})
public class RARequirements {
@XmlElement(name = "rASignatures")
@XmlSchemaType(name = "unsignedInt")
protected long raSignatures;
@XmlElement(name = "rAEKUs", required = true, nillable = true)
protected OIDReferenceCollection raekUs;
@XmlElement(name = "rAPolicies", required = true, nillable = true)
protected OIDReferenceCollection raPolicies;
/**
* Gets the value of the raSignatures property.
*
*/
public long getRASignatures() {
return raSignatures;
}
/**
* Sets the value of the raSignatures property.
*
*/
public void setRASignatures(long value) {
this.raSignatures = value;
}
/**
* Gets the value of the raekUs property.
*
* @return
* possible object is
* {@link OIDReferenceCollection }
*
*/
public OIDReferenceCollection getRAEKUs() {
return raekUs;
}
/**
* Sets the value of the raekUs property.
*
* @param value
* allowed object is
* {@link OIDReferenceCollection }
*
*/
public void setRAEKUs(OIDReferenceCollection value) {
this.raekUs = value;
}
/**
* Gets the value of the raPolicies property.
*
* @return
* possible object is
* {@link OIDReferenceCollection }
*
*/
public OIDReferenceCollection getRAPolicies() {
return raPolicies;
}
/**
* Sets the value of the raPolicies property.
*
* @param value
* allowed object is
* {@link OIDReferenceCollection }
*
*/
public void setRAPolicies(OIDReferenceCollection value) {
this.raPolicies = value;
}
}

@ -0,0 +1,100 @@
package cdm.api.windows.xcep.beans;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAnyElement;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
import org.w3c.dom.Element;
/**
* <p>Java class for RequestFilter complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="RequestFilter">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="policyOIDs" type="{http://schemas.microsoft.com/windows/pki/2009/01/enrollmentpolicy}FilterOIDCollection"/>
* &lt;any processContents='lax' maxOccurs="unbounded" minOccurs="0"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "RequestFilter", propOrder = {
"policyOIDs",
"any"
})
public class RequestFilter {
@XmlElement(required = true, nillable = true)
protected FilterOIDCollection policyOIDs;
@XmlAnyElement(lax = true)
protected List<Object> any;
/**
* Gets the value of the policyOIDs property.
*
* @return
* possible object is
* {@link FilterOIDCollection }
*
*/
public FilterOIDCollection getPolicyOIDs() {
return policyOIDs;
}
/**
* Sets the value of the policyOIDs property.
*
* @param value
* allowed object is
* {@link FilterOIDCollection }
*
*/
public void setPolicyOIDs(FilterOIDCollection value) {
this.policyOIDs = value;
}
/**
* Gets the value of the any property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the any property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getAny().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link Object }
* {@link Element }
*
*
*/
public List<Object> getAny() {
if (any == null) {
any = new ArrayList<Object>();
}
return this.any;
}
}

@ -0,0 +1,214 @@
package cdm.api.windows.xcep.beans;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAnyElement;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
import org.w3c.dom.Element;
/**
* <p>Java class for Response complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="Response">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="policyID" type="{http://www.w3.org/2001/XMLSchema}string"/>
* &lt;element name="policyFriendlyName" type="{http://www.w3.org/2001/XMLSchema}string"/>
* &lt;element name="nextUpdateHours" type="{http://www.w3.org/2001/XMLSchema}unsignedInt"/>
* &lt;element name="policiesNotChanged" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
* &lt;element name="policies" type="{http://schemas.microsoft.com/windows/pki/2009/01/enrollmentpolicy}PolicyCollection"/>
* &lt;any processContents='lax' maxOccurs="unbounded" minOccurs="0"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "Response", propOrder = {
"policyID",
"policyFriendlyName",
"nextUpdateHours",
"policiesNotChanged",
"policies",
"any"
})
public class Response {
@XmlElement(required = true)
protected String policyID;
@XmlElement(required = true, nillable = true)
protected String policyFriendlyName;
@XmlElement(required = true, type = Long.class, nillable = true)
@XmlSchemaType(name = "unsignedInt")
protected Long nextUpdateHours;
@XmlElement(required = true, type = Boolean.class, nillable = true)
protected Boolean policiesNotChanged;
@XmlElement(required = true, nillable = true)
protected PolicyCollection policies;
@XmlAnyElement(lax = true)
protected List<Object> any;
/**
* Gets the value of the policyID property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getPolicyID() {
return policyID;
}
/**
* Sets the value of the policyID property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setPolicyID(String value) {
this.policyID = value;
}
/**
* Gets the value of the policyFriendlyName property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getPolicyFriendlyName() {
return policyFriendlyName;
}
/**
* Sets the value of the policyFriendlyName property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setPolicyFriendlyName(String value) {
this.policyFriendlyName = value;
}
/**
* Gets the value of the nextUpdateHours property.
*
* @return
* possible object is
* {@link Long }
*
*/
public Long getNextUpdateHours() {
return nextUpdateHours;
}
/**
* Sets the value of the nextUpdateHours property.
*
* @param value
* allowed object is
* {@link Long }
*
*/
public void setNextUpdateHours(Long value) {
this.nextUpdateHours = value;
}
/**
* Gets the value of the policiesNotChanged property.
*
* @return
* possible object is
* {@link Boolean }
*
*/
public Boolean isPoliciesNotChanged() {
return policiesNotChanged;
}
/**
* Sets the value of the policiesNotChanged property.
*
* @param value
* allowed object is
* {@link Boolean }
*
*/
public void setPoliciesNotChanged(Boolean value) {
this.policiesNotChanged = value;
}
/**
* Gets the value of the policies property.
*
* @return
* possible object is
* {@link PolicyCollection }
*
*/
public PolicyCollection getPolicies() {
return policies;
}
/**
* Sets the value of the policies property.
*
* @param value
* allowed object is
* {@link PolicyCollection }
*
*/
public void setPolicies(PolicyCollection value) {
this.policies = value;
}
/**
* Gets the value of the any property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the any property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getAny().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link Object }
* {@link Element }
*
*
*/
public List<Object> getAny() {
if (any == null) {
any = new ArrayList<Object>();
}
return this.any;
}
}

@ -0,0 +1,74 @@
package cdm.api.windows.xcep.beans;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for Revision complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="Revision">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="majorRevision" type="{http://www.w3.org/2001/XMLSchema}unsignedInt"/>
* &lt;element name="minorRevision" type="{http://www.w3.org/2001/XMLSchema}unsignedInt"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "Revision", propOrder = {
"majorRevision",
"minorRevision"
})
public class Revision {
@XmlSchemaType(name = "unsignedInt")
protected long majorRevision;
@XmlSchemaType(name = "unsignedInt")
protected long minorRevision;
/**
* Gets the value of the majorRevision property.
*
*/
public long getMajorRevision() {
return majorRevision;
}
/**
* Sets the value of the majorRevision property.
*
*/
public void setMajorRevision(long value) {
this.majorRevision = value;
}
/**
* Gets the value of the minorRevision property.
*
*/
public long getMinorRevision() {
return minorRevision;
}
/**
* Sets the value of the minorRevision property.
*
*/
public void setMinorRevision(long value) {
this.minorRevision = value;
}
}

@ -0,0 +1,69 @@
package cdm.api.windows.xcep.beans;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for SupersededPolicies complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="SupersededPolicies">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element ref="{http://schemas.microsoft.com/windows/pki/2009/01/enrollmentpolicy}commonName" maxOccurs="unbounded"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "SupersededPolicies", propOrder = {
"commonName"
})
public class SupersededPolicies {
@XmlElement(required = true)
protected List<String> commonName;
/**
* Gets the value of the commonName property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the commonName property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getCommonName().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link String }
*
*
*/
public List<String> getCommonName() {
if (commonName == null) {
commonName = new ArrayList<String>();
}
return this.commonName;
}
}

@ -0,0 +1,2 @@
@javax.xml.bind.annotation.XmlSchema(namespace = "http://schemas.microsoft.com/windows/pki/2009/01/enrollmentpolicy", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
package cdm.api.windows.xcep.beans;

@ -0,0 +1,79 @@
/*
* Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package cdm.api.windows.xcep.impl;
import cdm.api.windows.xcep.IPolicy;
import cdm.api.windows.xcep.beans.*;
import javax.jws.WebService;
import javax.xml.ws.BindingType;
import javax.xml.ws.Holder;
import javax.xml.ws.soap.Addressing;
import javax.xml.ws.soap.SOAPBinding;
@WebService(endpointInterface = "cdm.api.windows.xcep.IPolicy", targetNamespace = "http://schemas.microsoft.com/windows/pki/2009/01/enrollmentpolicy")
@Addressing(enabled = true, required = true)
@BindingType(value = SOAPBinding.SOAP12HTTP_BINDING)
public class xcepimpl implements IPolicy {
@Override
public void getPolicies(Client client, RequestFilter requestFilter,
Holder<Response> response, Holder<CACollection> cAs,
Holder<OIDCollection> oIDs) {
System.out.println("CHECKED_SERVICE");
Response rs = new Response();
OIDCollection oidc = new OIDCollection();
CACollection cac = new CACollection();
PolicyCollection pc = new PolicyCollection();
CertificateEnrollmentPolicy cnp = new CertificateEnrollmentPolicy();
Attributes at = new Attributes();
PrivateKeyAttributes pkat = new PrivateKeyAttributes();
pkat.setMinimalKeyLength(2048);
at.setPolicySchema(3);
at.setPrivateKeyAttributes(pkat);
at.setHashAlgorithmOIDReference(0);
cnp.setPolicyOIDReference(0);
cnp.setAttributes(at);
pc.getPolicy().add(cnp);
rs.setPolicies(pc);
response.value = rs;
OID oid = new OID();
oid.setValue("1.3.14.3.2.29");
oid.setGroup(1);
oid.setOIDReferenceID(0);
oid.setDefaultName("szOID_OIWSEC_sha1RSASign");
oidc.getOID().add(oid);
cAs.value = cac;
oIDs.value = oidc;
}
}

@ -0,0 +1,58 @@
/*
* Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package cdm.api.windows.xcep.util;
import java.util.HashSet;
import java.util.Set;
import javax.xml.namespace.QName;
import javax.xml.ws.handler.MessageContext;
import javax.xml.ws.handler.soap.SOAPHandler;
import javax.xml.ws.handler.soap.SOAPMessageContext;
public class PPSRSOApMessageHandler implements SOAPHandler<SOAPMessageContext> {
@Override
public Set<QName> getHeaders() {
final QName securityHeader = new QName(
"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd",
"Security",
"wsse");
final HashSet headers = new HashSet();
headers.add(securityHeader);
System.out.println("CHECKED_HEADER");
return headers;
}
@Override public boolean handleMessage(SOAPMessageContext context) {
return true;
}
@Override public boolean handleFault(SOAPMessageContext context) {
return true;
}
@Override public void close(MessageContext context) {
}
}

@ -0,0 +1,40 @@
/*
* Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package cdm.api.windows.xcep.util;
import javax.security.auth.callback.Callback;
import javax.security.auth.callback.CallbackHandler;
import javax.security.auth.callback.UnsupportedCallbackException;
import java.io.IOException;
import org.apache.wss4j.common.ext.WSPasswordCallback;
public class ServerPasswordCallback implements CallbackHandler {
@Override public void handle(Callback[] callbacks)
throws IOException, UnsupportedCallbackException {
WSPasswordCallback pc = (WSPasswordCallback) callbacks[0];
System.out.println("CHECKED_BEFORE_IF_SECURITY");
if ("asok@wso2.com".equals(pc.getIdentifier())) {
System.out.println("CHECKED_IF_SECURITY");
pc.setPassword("admin");
}
}
}
Loading…
Cancel
Save