phax commented on code in PR #234:
URL: 
https://github.com/apache/santuario-xml-security-java/pull/234#discussion_r1383685527


##########
src/main/java/org/apache/xml/security/keys/derivedKey/DerivationAlgorithm.java:
##########
@@ -0,0 +1,57 @@
+/**
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.xml.security.keys.derivedKey;
+
+import org.apache.xml.security.encryption.XMLEncryptionException;
+import org.apache.xml.security.exceptions.XMLSecurityException;
+
+/**
+ * Interface is supported by classes to implement key derivation algorithms.
+ */
+public interface DerivationAlgorithm {
+
+    /**
+     * Derives a key from the given secret and other info. The inital derived 
key is size of
+     * offset + keyLength.
+     *
+     *
+     * @param secret    The "shared" secret to use for key derivation (e.g. 
the secret key)
+     * @param otherInfo as specified in [SP800-56A] the optional  attributes:  
AlgorithmID, PartyUInfo, PartyVInfo, SuppPubInfo and SuppPrivInfo attributes  
are concatenated to form a bit string “OtherInfo” that is used with the key 
derivation function.
+     * @param offset    the starting position in derived keying material of 
size: offset + keyLength
+     * @param keyLength The length of the key to derive
+     * @return The derived key
+     * @throws XMLEncryptionException
+     */
+    byte[] deriveKey(byte[] secret, byte[] otherInfo, int offset,
+                     long keyLength) throws XMLSecurityException;
+
+
+    /**
+     * Derives a key from the given secret and other info.
+     * @param secret

Review Comment:
   Maybe you can copy the Javadocs from above down to here



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@santuario.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to