incubator-amber-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r960535 - /incubator/amber/trunk/spec-api/src/main/java/org/apache/amber/signature/SignatureMethodAlgorithm.java
Date Mon, 05 Jul 2010 10:41:52 GMT
Author: simonetripodi
Date: Mon Jul  5 10:41:52 2010
New Revision: 960535

URL: http://svn.apache.org/viewvc?rev=960535&view=rev
Log:
first checkin of SignatureMethodAlgorithm interface

Added:
    incubator/amber/trunk/spec-api/src/main/java/org/apache/amber/signature/SignatureMethodAlgorithm.java
  (with props)

Added: incubator/amber/trunk/spec-api/src/main/java/org/apache/amber/signature/SignatureMethodAlgorithm.java
URL: http://svn.apache.org/viewvc/incubator/amber/trunk/spec-api/src/main/java/org/apache/amber/signature/SignatureMethodAlgorithm.java?rev=960535&view=auto
==============================================================================
--- incubator/amber/trunk/spec-api/src/main/java/org/apache/amber/signature/SignatureMethodAlgorithm.java
(added)
+++ incubator/amber/trunk/spec-api/src/main/java/org/apache/amber/signature/SignatureMethodAlgorithm.java
Mon Jul  5 10:41:52 2010
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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 org.apache.amber.signature;
+
+import org.apache.amber.OAuthRequest;
+
+/**
+ * Common definition of OAuth signature method algorithm.
+ *
+ * @version $Id$
+ */
+public interface SignatureMethodAlgorithm<S extends SigningKey, V extends VerifyingKey>
{
+
+    /**
+     * Returns the signing algorithm method.
+     *
+     * @return the signing algorithm method.
+     */
+    String getAlgorithmMethod();
+
+    /**
+     * Calculates the OAuth request message signature.
+     *
+     * @param signingKey the key has to be used to sign the request.
+     * @param request the OAuth request message has to be signed.
+     * @return the calculated signature.
+     * @throws SignatureException if any error occurs.
+     */
+    String calculate(S signingKey, OAuthRequest request) throws SignatureException;
+
+    /**
+     * Verifies the OAuth request message signature.
+     *
+     * @param signature the OAuth signature has to be verified.
+     * @param verifyingKey the key has to be used to verify the request.
+     * @param request the signed OAuth request message.
+     * @return true if the signature is correct, false otherwise.
+     * @throws SignatureException if any error occurs.
+     */
+    boolean verify(String signature,
+            V verifyingKey,
+            OAuthRequest request) throws SignatureException;
+
+}

Propchange: incubator/amber/trunk/spec-api/src/main/java/org/apache/amber/signature/SignatureMethodAlgorithm.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/amber/trunk/spec-api/src/main/java/org/apache/amber/signature/SignatureMethodAlgorithm.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: incubator/amber/trunk/spec-api/src/main/java/org/apache/amber/signature/SignatureMethodAlgorithm.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message