Package org.mozilla.jss.crypto
Class JSSOAEPParameterSpec
- java.lang.Object
-
- org.mozilla.jss.util.NativeEnclosure
-
- org.mozilla.jss.crypto.JSSOAEPParameterSpec
-
- All Implemented Interfaces:
java.lang.AutoCloseable
,java.security.spec.AlgorithmParameterSpec
public class JSSOAEPParameterSpec extends NativeEnclosure implements java.security.spec.AlgorithmParameterSpec
This class is utilized by JSS to implement OAEP support. Unlike the existing OAEPParameterSpec in the JCA, this class supports NativeEnclosure, allowing it to be used within low-level JNI calls. We support copying from an existing OAEPParameterSpec instance (so use is interchangeable within JSS) and support setting members from JSS-specific types. Note that this class cannot be used with other JCA providers natively.
-
-
Field Summary
Fields Modifier and Type Field Description long
hashAlg
long
mgf
byte[]
sourceData
-
Fields inherited from class org.mozilla.jss.util.NativeEnclosure
mPointer, mPointerSize
-
-
Constructor Summary
Constructors Constructor Description JSSOAEPParameterSpec(java.lang.String mdName, java.lang.String mgfName, java.security.spec.AlgorithmParameterSpec mgfSpec, javax.crypto.spec.PSource pSrc)
JSSOAEPParameterSpec(javax.crypto.spec.OAEPParameterSpec copy)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
acquireNativeResources()
Allocate native resources, setting mPointer and mPointerSize as appropriate.protected void
releaseNativeResources()
Called to deallocate native resources; note that mPointer.close() is called afterwards.void
setDigestAlgorithm(long algo)
void
setDigestAlgorithm(java.lang.String algo)
void
setDigestAlgorithm(DigestAlgorithm algo)
void
setMaskGenAlgorithm(java.lang.String algo)
void
setMaskGenAlgorithmType(long algo)
void
setMaskGenAlgorithmType(java.lang.String algo)
void
setMaskGenAlgorithmType(java.security.spec.AlgorithmParameterSpec algo)
void
setPSource(byte[] data)
void
setPSource(javax.crypto.spec.PSource spec)
-
Methods inherited from class org.mozilla.jss.util.NativeEnclosure
close, finalize, open
-
-
-
-
Method Detail
-
setDigestAlgorithm
public void setDigestAlgorithm(java.lang.String algo) throws java.lang.IllegalArgumentException
- Throws:
java.lang.IllegalArgumentException
-
setDigestAlgorithm
public void setDigestAlgorithm(DigestAlgorithm algo) throws java.lang.IllegalArgumentException
- Throws:
java.lang.IllegalArgumentException
-
setDigestAlgorithm
public void setDigestAlgorithm(long algo) throws java.lang.IllegalArgumentException
- Throws:
java.lang.IllegalArgumentException
-
setMaskGenAlgorithm
public void setMaskGenAlgorithm(java.lang.String algo) throws java.lang.IllegalArgumentException
- Throws:
java.lang.IllegalArgumentException
-
setMaskGenAlgorithmType
public void setMaskGenAlgorithmType(java.lang.String algo) throws java.lang.IllegalArgumentException
- Throws:
java.lang.IllegalArgumentException
-
setMaskGenAlgorithmType
public void setMaskGenAlgorithmType(java.security.spec.AlgorithmParameterSpec algo) throws java.lang.IllegalArgumentException
- Throws:
java.lang.IllegalArgumentException
-
setMaskGenAlgorithmType
public void setMaskGenAlgorithmType(long algo) throws java.lang.IllegalArgumentException
- Throws:
java.lang.IllegalArgumentException
-
setPSource
public void setPSource(javax.crypto.spec.PSource spec) throws java.lang.IllegalArgumentException
- Throws:
java.lang.IllegalArgumentException
-
setPSource
public void setPSource(byte[] data) throws java.lang.IllegalArgumentException
- Throws:
java.lang.IllegalArgumentException
-
acquireNativeResources
protected void acquireNativeResources() throws java.lang.Exception
Description copied from class:NativeEnclosure
Allocate native resources, setting mPointer and mPointerSize as appropriate.- Specified by:
acquireNativeResources
in classNativeEnclosure
- Throws:
java.lang.Exception
-
releaseNativeResources
protected void releaseNativeResources() throws java.lang.Exception
Description copied from class:NativeEnclosure
Called to deallocate native resources; note that mPointer.close() is called afterwards. If mPointer.close() should be a no-op, extend from StaticVoidRef and do any required cleanup here.- Specified by:
releaseNativeResources
in classNativeEnclosure
- Throws:
java.lang.Exception
-
-