001/*
002 * (C) Copyright 2010 Nuxeo SA (http://nuxeo.com/) and others.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *     http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 *
016 * Contributors:
017 *     Nuxeo - initial API and implementation
018 */
019package org.nuxeo.ecm.platform.oauth.keys;
020
021import org.nuxeo.common.xmap.annotation.XNode;
022import org.nuxeo.common.xmap.annotation.XObject;
023
024/**
025 * Xmap object used to represent the contribution to {@link OAuthServerKeyManager}. => contribute a simple RSA Key
026 * Pair.
027 *
028 * @author tiry
029 */
030@XObject("serverKeyPair")
031public class ServerKeyDescriptor {
032
033    @XNode("privateKey")
034    protected String externalPrivateKey;
035
036    /**
037     * Most folks should not need to change this from the default value of nuxeo. It's unclear that there are many
038     * service providers that actually use this value.
039     */
040    @XNode("privateKeyName")
041    protected String externalPrivateKeyName;
042
043    /**
044     * This is here just for convenience of keeping everything together. This is the public key (really a certificate)
045     * that you need to give to external oauth provider to indicate that you have the private key above. Assuming you
046     * generated the key with the lines above, you should be able to simply paste the "certificate" portion of the
047     * testkey.pem file into this field. It is not used by nuxeo in any way, but <b>will</b> be needed when you
048     * configure an external provider.
049     * <p>
050     * Note that many providers accept the certificate then run a computation to extract the public key from it. This
051     * means that the value displayed when you look at the provider configuration may be different than the one you
052     * provided.
053     */
054    @XNode("publicCertificate")
055    protected String externalPublicCertificate;
056
057}