throw new GSSException(GSSException.BAD_MECH); throw new GSSException(GSSException.BAD_MECH);
@Override public void verifyMIC(byte[] inToken, int tokOffset, int tokLen, byte[] inMsg, int msgOffset, int msgLen, MessageProp msgProp) throws GSSException { if (!Arrays.equals(MIC, Arrays.copyOfRange(inToken, tokOffset, tokOffset + tokLen))) { throw new GSSException(GSSException.BAD_MIC); } }
@Override public boolean equals(GSSName another) throws GSSException { if (!(another instanceof BogusGSSName)) { throw new GSSException(GSSException.BAD_NAMETYPE); } BogusGSSName otherName = (BogusGSSName) another; return name.equals(otherName.name) && oid.equals(otherName.oid); }
static GSSException unavailable() throws GSSException { GSSException e = new GSSException(GSSException.UNAVAILABLE); log.error(e.getMessage(), e); throw e; } }
throw new GSSException(GSSException.BAD_MECH); messageDigest = MessageDigest.getInstance("SHA-1"); } catch (NoSuchAlgorithmException e) { throw new GSSException(GSSException.FAILURE);
String decodedOid = decoder.decodeObjectIdentifier(); if (! mechanism.equals(new Oid(decodedOid))) { throw new GSSException(GSSException.DEFECTIVE_TOKEN);
/** * Currently not implemented. */ public void unwrap(InputStream inStream, OutputStream outStream, MessageProp msgProp) throws GSSException { throw new GSSException(GSSException.UNAVAILABLE); }
/** * Currently not implemented. */ public GSSName createName(byte name[], Oid nameType) throws GSSException { throw new GSSException(GSSException.UNAVAILABLE); }
/** * Currently not implemented. */ public void verifyMIC(InputStream tokStream, InputStream msgStream, MessageProp msgProp) throws GSSException { throw new GSSException(GSSException.UNAVAILABLE); }
/** * Currently not implemented. */ public void addProviderAtEnd(Provider p, Oid mech) throws GSSException { // this GSSManager implementation does not support an SPI // with a pluggable provider architecture throw new GSSException(GSSException.UNAVAILABLE); }
/** * Currently not implemented. */ public void wrap(InputStream inStream, OutputStream outStream, MessageProp msgProp) throws GSSException { throw new GSSException(GSSException.UNAVAILABLE); }
/** * Currently not implemented. */ public void getMIC(InputStream inStream, OutputStream outStream, MessageProp msgProp) throws GSSException { throw new GSSException(GSSException.UNAVAILABLE); }
/** * Currently not implemented. */ public byte [] export() throws GSSException { throw new GSSException(GSSException.UNAVAILABLE); }
/** * Currently not implemented. */ public GSSName createName(String nameStr, Oid nameType, Oid mech) throws GSSException { throw new GSSException(GSSException.UNAVAILABLE); }
/** * Currently not implemented. */ public void addProviderAtEnd(Provider p, Oid mech) throws GSSException { // this GSSManager implementation does not support an SPI // with a pluggable provider architecture throw new GSSException(GSSException.UNAVAILABLE); }
public void getMic(OutputStream os) throws GSSException { try { encodeHeader(os); } catch (IOException e) { throw new GSSException(GSSException.FAILURE, -1, "Error in output MicTokenV1 bytes:" + e.getMessage()); } }
public int getRemainingAcceptLifetime(Oid mech) throws GSSException { GlobusGSSManagerImpl.checkMechanism(mech); if (this.usage == ACCEPT_ONLY || this.usage == INITIATE_AND_ACCEPT) { return getRemainingLifetime(); } else { throw new GSSException(GSSException.FAILURE); } }
protected void verifyToken(byte[] confounder, byte[] data, int dataOffset, int dataLength, int paddingLen) throws GSSException { byte[] sum = calcCheckSum(confounder, commHeader, data, dataOffset, dataLength, paddingLen); if (!MessageDigest.isEqual(checkSum, sum)) { throw new GSSException(GSSException.BAD_MIC, -1, "Corrupt token checksum for " + (tokenType == TOKEN_MIC_V1 ? "Mic" : "Wrap") + "TokenV1"); } }
public int getRemainingInitLifetime(Oid mech) throws GSSException { GlobusGSSManagerImpl.checkMechanism(mech); if (this.usage == INITIATE_ONLY || this.usage == INITIATE_AND_ACCEPT) { return getRemainingLifetime(); } else { throw new GSSException(GSSException.FAILURE); } }
public byte[] decryptData(byte[] dataEncrypted, int keyUsage) throws GSSException { byte[] ret; try { EncTypeHandler encHandler = EncryptionHandler.getEncHandler(encKey.getKeyType()); ret = encHandler.decrypt(dataEncrypted, encKey.getKeyData(), keyUsage); } catch (KrbException e) { throw new GSSException(GSSException.FAILURE, -1, e.getMessage()); } return ret; }