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 */
019
020package org.nuxeo.ecm.platform.oauth.keys;
021
022import org.nuxeo.ecm.platform.oauth.consumers.NuxeoOAuthConsumer;
023
024/**
025 * Service to manage the key and shared secret used by Nuxeo server :
026 * <ul>
027 * <li>private/public key pair used by Nuxeo to use Signed request with RSA
028 * <li>shared key between Nuxeo and Shindig to manage Signed Fetch
029 * </ul>
030 *
031 * @author tiry
032 */
033public interface OAuthServerKeyManager {
034
035    /**
036     * Returns the Public Key certificate used by Nuxeo server to do RSA Signing.
037     */
038    String getPublicKeyCertificate();
039
040    /**
041     * Returns the Public Key certificate used by Nuxeo server to do RSA Signing. (Removes OpenSSL decorators).
042     */
043    String getBarePublicCertificate();
044
045    /**
046     * Returns the Private Key used by Nuxeo server to do RSA Signing.
047     */
048    String getPrivateKey();
049
050    /**
051     * Returns the Private Key used by Nuxeo server to do RSA Signing. (Removes OpenSSL decorators).
052     */
053    String getBarePrivateKey();
054
055    /**
056     * Returns key name (not really used).
057     */
058    String getKeyName();
059
060    /**
061     * Returns the consumerKey used in Shindig => Nuxeo sign fetch.
062     */
063    String getInternalKey();
064
065    /**
066     * Returns the consumerSecret (HMAC) used in Shindig => Nuxeo sign fetch.
067     */
068    String getInternalSecret();
069
070    /**
071     * Returns the {@link NuxeoOAuthConsumer} representing local (embedded) Shindig instance.
072     */
073    NuxeoOAuthConsumer getInternalConsumer();
074
075}